From: Michael <mi...@st...> - 2000-10-05 19:52:08
|
Michael Ströder wrote: > > Ok, I edited Modules/LDAPObject.c to use only 2 arguments. The > module builds now and import ldap works. But it gives me undefined > exceptions. > > ldap.LDAPError: unknown error (C API does not expose error) It's me again. ;-) I managed to connect to a OpenLDAP 2.0.6 server (which is LDAPv3). Connecting to OpenLDAP 1.2.11 server (LDAPv2) does not work. It seems it has something to do with choosing LDAPv3 during connect and falling back to LDAPv2 if v3 fails. I can browse my test data on the OpenLDAP 2.0 server. But when I hit a LDAPv3 referral entry the exception above is raised. I guess the C-LDAP-SDK returns some LDAPv3 specific data not known to python-ldap. BTW: The following code is also rejected (it works with OpenLDAP 1.2.11 libs): ldap_obj.deref = ldap.DEREF_NEVER ldap_obj.options = 0 Traceback: [..] ldap_obj.options = 0 NameError: cannot set that field Why I want this? I would like to actively catch LDAPv3 referrals. This works slightly well with catching ldap.PARTIAL_RESULTS and pulling the referral LDAP URL out of the info field. However, if binding via LDAPv2 (OpenLDAP 1.2.x libs) to a LDAPv3 server 1. the server is free to just ignore my request if a referral is hit and 2. I don't get the search continuations of the referral entry when doing a one level search. This causes a lot of inconsistent behaviour of my client (besides all those broken LDAP servers out there...sigh!). LDAPv2 vs. LDAPv3 binding also affects all kind of RootDSE attributes and schema information... Ciao, Michael. |