From: Jeffrey C. O. <je...@ol...> - 2000-11-16 22:21:08
Attachments:
python-ldap.patch
|
I've gotten today's CVS version to compile against OpenLDAP 2.0.7. It seems that the OpenLDAP people dropped a number of macros between v1 and v2. A fairly simple patch that #ifdefs the dropped macros and everything compiles fine. Oh yeah, I did have to use "LIBS=-lresolv ./configure" to get the configure script to properly: apparently the RedHat RPM for OpenLDAP introduces a depencency because the configure script fails with an undefined reference to __dn_expand and __res_query. I've attached the patch and also entered a bug on sourceforge. Jeff |
From: Michael <mi...@st...> - 2000-11-16 22:56:05
|
"Jeffrey C. Ollie" wrote: > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7. Ooops. Double efforts. I'm currently testing patches by Konstantin (Cc:-ed) which also allow to retrieve search continuation references (LDAPv3 referrals). He made some changes to attributes of LDAPObject. Especially setting the options is different. Would be nice if you coordinate your work. Thanks to both of you. Ciao, Michael. |
From: Jeffrey C. O. <je...@ol...> - 2000-11-17 05:01:35
|
On Thu, Nov 16, 2000 at 11:55:57PM +0100, Michael Str=F6der wrote: > "Jeffrey C. Ollie" wrote: > >=20 > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7. >=20 > Ooops. Double efforts. I'm currently testing patches by Konstantin > (Cc:-ed) which also allow to retrieve search continuation references > (LDAPv3 referrals). >=20 > He made some changes to attributes of LDAPObject. Especially setting > the options is different. I didn't know that anyone else was working on it... The list has been quiet for some time now. It looks like Konstantin's work goes beyond what I intended to accomplish. I wasn't looking to add any functionality, just to get python-ldap to compile and work. But I'd be happy to test out other patches and perhaps fix a bug or two. Jeff |
From: Konstantin C. <Kon...@da...> - 2000-11-17 10:47:43
|
Hello Jeffrey and all. Attached are recent version of my patches, if you are interested. They provide the following: * automatic recognition of OpenLDAP-1.2.x or OpenLDAP-2.0.x at compilation time, building different sets of Python LDAP constants and error exception objects for different OpenLDAP versions; * special tuples for continuation references: (None, [list_of_URLs]). Compare to normal entry tuples: (DN, {dict_of_attributes}). Both types of tuples can be returned from search methods; * new type of result type in the result method: SEARCH_REFERENCE. * a few new ldap object attributes, among them: referrals - disables (0) or enables (1) following referrals; is set to 1 after ldap object initialisation; version (2 or 3) - sets LDAP protocol version (default is 2). Any comments/suggestions/fixes are welcome. Regards, Konstantin. "Jeffrey C. Ollie" wrote: > On Thu, Nov 16, 2000 at 11:55:57PM +0100, Michael Ströder wrote: > > "Jeffrey C. Ollie" wrote: > > > > > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7. > > > > Ooops. Double efforts. I'm currently testing patches by Konstantin > > (Cc:-ed) which also allow to retrieve search continuation references > > (LDAPv3 referrals). > > > > He made some changes to attributes of LDAPObject. Especially setting > > the options is different. > > I didn't know that anyone else was working on it... The list has been > quiet for some time now. It looks like Konstantin's work goes beyond > what I intended to accomplish. I wasn't looking to add any > functionality, just to get python-ldap to compile and work. But I'd > be happy to test out other patches and perhaps fix a bug or two. > > Jeff > > ------------------------------------------------------------------------ > Part 1.2Type: application/pgp-signature -- * * Konstantin Chuguev - Application Engineer * * Francis House, 112 Hills Road * Cambridge CB2 1PQ, United Kingdom D A N T E WWW: http://www.dante.net |
From: David L. <dav...@ds...> - 2000-11-17 14:46:13
|
Hi everyone. I'm in germany at the moment hey these patches look ok i have a medium concern, something that i've been guilty of and would like to see go away, and that is conditional existance of interfaces. eg ufn_search_s() might be #ifdef'd out and some python program that wants to use it will get a NameError when it tries to use it. A better exception would be NotImplementedError. ie instead of writing #ifdef LDAP_API_THING ldap_ufn_search_s(PyObject blah, blah) { blah; } #endif it ought to be ldap_ufn_search_s(PyObject blah, blah) { #ifdef LDAP_API_THING blah; #else return Py_ErrObject(Py_NotImplementeError); #endif } A similar problem arises with 'constants'.. I'm not sure what to do here.. make all undefined cosntants equal None? also there should be some nice way of reliably determining the underlying library's api version ... maybe _ldap.api_version... any suggestions on how that might be done nicely are welcome. tschuss! d On Fri, 17 Nov 2000, Konstantin Chuguev typed thusly: > Hello Jeffrey and all. > > Attached are recent version of my patches, if you are interested. They > provide the following: > > * automatic recognition of OpenLDAP-1.2.x or OpenLDAP-2.0.x at compilation > time, building different sets of Python LDAP constants and error > exception objects for different OpenLDAP versions; > * special tuples for continuation references: (None, [list_of_URLs]). > Compare to normal entry tuples: (DN, {dict_of_attributes}). Both types > of tuples can be returned from search methods; > * new type of result type in the result method: SEARCH_REFERENCE. > * a few new ldap object attributes, among them: referrals - disables (0) > or enables (1) following referrals; is set to 1 after ldap object > initialisation; version (2 or 3) - sets LDAP protocol version (default > is 2). > > Any comments/suggestions/fixes are welcome. > > > Regards, > Konstantin. > > "Jeffrey C. Ollie" wrote: > > > On Thu, Nov 16, 2000 at 11:55:57PM +0100, Michael Ströder wrote: > > > "Jeffrey C. Ollie" wrote: > > > > > > > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7. > > > > > > Ooops. Double efforts. I'm currently testing patches by Konstantin > > > (Cc:-ed) which also allow to retrieve search continuation references > > > (LDAPv3 referrals). > > > > > > He made some changes to attributes of LDAPObject. Especially setting > > > the options is different. > > > > I didn't know that anyone else was working on it... The list has been > > quiet for some time now. It looks like Konstantin's work goes beyond > > what I intended to accomplish. I wasn't looking to add any > > functionality, just to get python-ldap to compile and work. But I'd > > be happy to test out other patches and perhaps fix a bug or two. > > > > Jeff > > > > ------------------------------------------------------------------------ > > Part 1.2Type: application/pgp-signature > > -- > * * Konstantin Chuguev - Application Engineer > * * Francis House, 112 Hills Road > * Cambridge CB2 1PQ, United Kingdom > D A N T E WWW: http://www.dante.net > > > -- David Leonard Dav...@ds... DSTC Room:78-632 Ph:+61 7 336 58358 The University of Queensland http://www.dstc.edu.au/ QLD 4072 AUSTRALIA B73CD65FBEF4C089B79A8EBADF1A932F13EA0FC8 Cassette tapes have an almost unlimited capacity for data. - Commodore 64 Programmer's Reference Guide (1983) |
From: Jeffrey C. O. <je...@ol...> - 2000-11-17 15:56:39
|
On Fri, Nov 17, 2000 at 03:34:54PM +0100, David Leonard wrote: >=20 > eg ufn_search_s() might be #ifdef'd out and some python program that wan= ts > to use it will get a NameError when it tries to use it. A better exception > would be NotImplementedError. I don't have a huge problem with that. > A similar problem arises with 'constants'.. I'm not sure what to do here.. > make all undefined cosntants equal None? No, as this will cause problems that are harder to debug as None may be a valid parameter in some cases. If you let NameError exceptions be raised you can immediately track down the offending reference. I don't think that adding code to raise NotImplementedError in the case of undefined constants buys you anything but code bloat. > also there should be some nice way of reliably determining the > underlying library's api version ... maybe _ldap.api_version... > any suggestions on how that might be done nicely are welcome. I'd suggest using LDAP_API_VERSION, LDAP_VENDOR_NAME, and LDAP_VENDOR_VERSION. There are also some miscellaneous LDAP_API_FEATURE* macros. Jeff P.S. Konstantin: I didn't receive a copy of your e-mail with the patches, could you try sending it again? |
From: Michael <mi...@st...> - 2000-11-17 18:51:26
|
David Leonard wrote: > > i have a medium concern, something that i've been guilty of and would like > to see go away, and that is conditional existance of interfaces. > > eg ufn_search_s() might be #ifdef'd out and some python program that wants > to use it will get a NameError when it tries to use it. A better exception > would be NotImplementedError. Kick it out. Even the exception you mentioned isn't necessary. No serious LDAP programmer used it I guess. > A similar problem arises with 'constants'.. I'm not sure what to do here.. > make all undefined cosntants equal None? Just kick it out. > also there should be some nice way of reliably determining the > underlying library's api version ... maybe _ldap.api_version... > any suggestions on how that might be done nicely are welcome. I even have no problems with starting from scratch. I happily rewrite the changed parts in web2ldap just to get proper LDAPv3 support and SSL/TLS... Maybe let's start with a new LDAPEXT-inspired python-ldap 2.x? Ciao, Michael. |
From: Michael <mi...@st...> - 2000-11-17 18:26:15
|
"Jeffrey C. Ollie" wrote: > > On Thu, Nov 16, 2000 at 11:55:57PM +0100, Michael Ströder wrote: > > "Jeffrey C. Ollie" wrote: > > > > > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7. > > > > Ooops. Double efforts. I'm currently testing patches by Konstantin > > (Cc:-ed) which also allow to retrieve search continuation references > > (LDAPv3 referrals). > > > > He made some changes to attributes of LDAPObject. Especially setting > > the options is different. > > I didn't know that anyone else was working on it... The list has been > quiet for some time now. We did not expect anybody else to work on it. Therefore there was no announcement here. > It looks like Konstantin's work goes beyond > what I intended to accomplish. I wasn't looking to add any > functionality, just to get python-ldap to compile and work. Well, when building against OpenLDAP 2.0.x libs you gain some new important features. Especially LDAPv3 is what we basically need to handle referrals in a reasonable manner. This might lead to incompatible python-ldap API but the new features are worth it, I think. > But I'd > be happy to test out other patches and perhaps fix a bug or two. Well, are you interested in adding new functionality? If yes, SSL/TLS support and some parts of the new LDAPEXT-API would be nice. I'm not a C programmer myself. I can just provide help with designing the new API and doing extensive tests. Ciao, Michael. |
From: Jeffrey C. O. <je...@ol...> - 2000-11-17 20:15:17
|
On Fri, Nov 17, 2000 at 07:48:18AM +0100, Michael Str=F6der wrote: > "Jeffrey C. Ollie" wrote: > >=20 > > I didn't know that anyone else was working on it... The list has been > > quiet for some time now. >=20 > We did not expect anybody else to work on it. Therefore there was no > announcement here. >=20 > > It looks like Konstantin's work goes beyond what I intended to > > accomplish. I wasn't looking to add any functionality, just to > > get python-ldap to compile and work. >=20 > Well, when building against OpenLDAP 2.0.x libs you gain some new > important features. Especially LDAPv3 is what we basically need to > handle referrals in a reasonable manner. This might lead to > incompatible python-ldap API but the new features are worth it, I > think. Yes, a worthy goal. However, it'd be nice to get a version out the door that compiles/links against 2.0.x and then worry about new functionality introduced by LDAPv3. > > But I'd be happy to test out other patches and perhaps fix a bug > > or two. > > Well, are you interested in adding new functionality? If yes, > SSL/TLS support and some parts of the new LDAPEXT-API would be nice. > I'm not a C programmer myself. I can just provide help with > designing the new API and doing extensive tests. SSL/TLS would be high on my priority list. I do know how to program in C but programming isn't my primary duty at work and I don't ever seem to get much free time at home that I can work on programming. But who knows, maybe I'll stay up late one night... Jeff |
From: Michael <mi...@st...> - 2000-11-17 21:01:58
|
"Jeffrey C. Ollie" wrote: > > Yes, a worthy goal. However, it'd be nice to get a version out the > door that compiles/links against 2.0.x and then worry about new > functionality introduced by LDAPv3. Konstantin's patches already compile cleanly and work. I will do further testing this weekend. The most important goal was to be able to bind as a LDAPv3 client. > SSL/TLS would be high on my priority list. I do know how to program > in C but programming isn't my primary duty at work and I don't ever > seem to get much free time at home that I can work on programming. One of the main advantages of the OpenLDAP 2.0.x libs is that they have already built-in support for LDAP over SSL, LDAP with STARTTLS extension and SASL binding. Theoretically you can enable features this by setting the right options... Ciao, Michael. |