Hi Michael,
I now have a fresh Ubuntu 7.10 install with OpenLDAP 2.1 in /usr/lib and a
manually
compiled OpenLDAP 2.3.39 in /usr/local/lib.
The appropriate dirs are in setup.cfg:
library_dirs = /usr/local/lib
include_dirs = /usr/local/include /usr/include/sasl
ldd _ldap.so says that python-ldap links to the right one:
linux-gate.so.1 => (0xffffe000)
libldap_r-2.3.so.0 => /usr/local/lib/libldap_r-2.3.so.0 (0xb7f36000)
liblber-2.3.so.0 => /usr/local/lib/liblber-2.3.so.0 (0xb7f29000)
libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7f06000)
libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb7ec5000)
libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7d82000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d6a000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c20000)
libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7c0c000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7c08000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7bf3000)
/lib/ld-linux.so.2 (0x80000000)
Doing a simple_bind_s() on ldap.openldap.org works:
...
wait4msg ld 0x81e50b8 msgid 1 (infinite timeout)
wait4msg continue ld 0x81e50b8 msgid 1 all 1
** ld 0x81e50b8 Connections:
* host: ldap.openldap.org port: 389 (default)
refcnt: 2 status: Connected
last used: Sat Dec 29 15:11:47 2007
** ld 0x81e50b8 Outstanding Requests:
* msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
** ld 0x81e50b8 Response Queue:
Empty
ldap_chkResponseList ld 0x81e50b8 msgid 1 all 1
ldap_chkResponseList returns ld 0x81e50b8 NULL
ldap_int_select
read1msg: ld 0x81e50b8 msgid 1 all 1
read1msg: ld 0x81e50b8 msgid 1 message type bind
new result: res_errno: 0, res_error: <>, res_matched: <>
read1msg: ld 0x81e50b8 0 new referrals
read1msg: mark request completed, ld 0x81e50b8 msgid 1
request done: ld 0x81e50b8 msgid 1
res_errno: 0, res_error: <>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_free_connection 0 1
ldap_free_connection: refcnt 1
ldap_parse_result
ldap_msgfree
=> result: (97, [], 1, [])
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed
But a simple_bind_s() on bluepages.ibm.com doesn't:
wait4msg continue ld 0x81e4ef0 msgid 1 all 1
** ld 0x81e4ef0 Connections:
* host: bluepages.ibm.com port: 636 (default)
refcnt: 2 status: Connected
last used: Sat Dec 29 15:11:16 2007
** ld 0x81e4ef0 Outstanding Requests:
* msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
** ld 0x81e4ef0 Response Queue:
Empty
ldap_chkResponseList ld 0x81e4ef0 msgid 1 all 1
ldap_chkResponseList returns ld 0x81e4ef0 NULL
ldap_int_select
read1msg: ld 0x81e4ef0 msgid 1 all 1
ldap_err2string
=> LDAPError - LOCAL_ERROR: {'desc': 'Local error'}
Traceback (most recent call last):
File "test.py", line 10, in <module>
l.simple_bind_s();
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line
199, in simple_bind_s
return self.result(msgid,all=1,timeout=self.timeout)
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line
428, in result
res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line
432, in result2
res_type, res_data, res_msgid, srv_ctrls =
self.result3(msgid,all,timeout)
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line
438, in result3
rtype, rdata, rmsgid, serverctrls =
self._ldap_call(self._l.result3,msgid,all,timeout)
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 97,
in _ldap_call
result = func(*args,**kwargs)
ldap.LOCAL_ERROR: {'desc': 'Local error'}
ldap_free_request (origid 1, msgid 1)
ldap_free_connection 1 1
ldap_send_unbind
ldap_free_connection: actually freed
However, ldapsearch doesn't crash at this point:
...
** ld 0x8084d08 Response Queue:
Empty
ldap_chkResponseList ld 0x8084d08 msgid 1 all 1
ldap_chkResponseList returns ld 0x8084d08 NULL
ldap_int_select
read1msg: ld 0x8084d08 msgid 1 all 1
ber_get_next
ber_get_next: tag 0x30 len 16 contents:
read1msg: ld 0x8084d08 msgid 1 message type bind
ber_scanf fmt ({eaa) ber:
read1msg: ld 0x8084d08 0 new referrals
read1msg: mark request completed, ld 0x8084d08 msgid 1
request done: ld 0x8084d08 msgid 1
res_errno: 0, res_error: <>, res_matched: <>
...
It probably uses the OpenLDAP 2.1 libraries, though. I could make it use
the 2.3 ones if it would help.
Michael Ströder <[EMAIL PROTECTED]> wrote on 22/12/2007 07:18:31 AM:
>
> Out of curiosity: What kind of server is this (vendor/version)?
It's Tivoli Directory Server 5.2:
dn:
namingcontexts: CN=SCHEMA
namingcontexts: CN=LOCALHOST
namingcontexts: CN=PWDPOLICY
namingcontexts: CN=IBMPOLICIES
namingcontexts: O=IBM.COM
namingcontexts: O=DELETED.IBM.COM
subschemasubentry: cn=schema
...
secureport: 636
security: ssl
port: 389
supportedsaslmechanisms: CRAM-MD5
supportedsaslmechanisms: DIGEST-MD5
supportedldapversion: 2
supportedldapversion: 3
ibmdirectoryversion: 5.2
ibm-ldapservicename: d03ldr215a
ibm-serverId: 34519bc0-4c01-102b-8a2e-caf840af47c5
...
vendorname: International Business Machines (IBM)
vendorversion: 5.2
...
ibm-slapdisconfigurationmode: FALSE
ibm-slapdSizeLimit: 100000
ibm-slapdTimeLimit: 0
ibm-slapdDerefAliases: never
ibm-supportedAuditVersion: 2
ibm-sasldigestrealmname: d03ldr215a
Could the blank dn be a problem?
What can I do? What can I log? I tried telneting to the ldap server, but
that didn't give any useful output.
Thanks,
Leons Petrazickis
http://lpetr.org/blog/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev