Skip to content
Snippets Groups Projects

Add proper support for LDAP

Merged Dmitry Ivanov requested to merge funbringer/picodata-ldap-support into master
All threads resolved!
2 files
+ 15
16
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 13
12
local console = require("console")
local uri = ...
local TIMEOUT_INFINITY = 100 * 365 * 86400
local arg = ...
local opts = {}
opts.timeout = TIMEOUT_INFINITY
console.on_start(function(self)
local status, reason
status, reason = pcall(
console.connect,
arg,
{connect_timeout = TIMEOUT_INFINITY}
)
status, reason = pcall(console.connect, uri, opts)
if not status then
self:print(reason)
os.exit(0)
-- `type(reason) == cdata`, so we have to convert it
self:print(tostring(reason))
os.exit(1)
end
end)
console.on_client_disconnect(function(_)
os.exit(0)
-- We should only set this after we try to connect, because
-- `console.connect` will call this before throwing eval errors
console.on_client_disconnect(function(_)
os.exit(0)
end)
end)
return console.start()
Loading