-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
I'm trying to use lualdap, but it doesn't work for me. My code is as below:
require 'lualdap'
ld = lualdap.open_simple("my-ldap-server", "user", "pass")
if ld == nil then
print("LDAP not connected!")
return 1
end
for dn, attribs in ld:search { base = "dc=mycompany,dc=com" } do
print (string.format ("\t[%s]\n", dn))
for name, values in pairs (attribs) do
io.write ("["..name.."] : ")
if type (values) == "string" then
io.write (values)
elseif type (values) == "table" then
local n = table.getn(values)
for i = 1, (n-1) do
io.write (values[i]..",")
end
io.write (values[n])
end
io.write ("\n")
end
end
ld:close()
print("Done!!")
In the meantime, if I use ldapsearch to do same search:
$ ldapsearch -D user -w pass -h my-ldap-server -b 'dc=mycompany,dc=com'
the ldapsearch command works, returning LDAP records.
Why's wrong with my code?
Metadata
Metadata
Assignees
Labels
No labels