From brad.allen at omsdal.com Sat Jul 1 16:56:26 2006 From: brad.allen at omsdal.com (brad.allen at omsdal.com) Date: Sat, 1 Jul 2006 09:56:26 -0500 Subject: Mac OS X Binary Download In-Reply-To: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> Message-ID: Thanks! Do you also have one for the Python 2.3.5 that comes bundled with Mac OS X? Ben Gollmer wrote on 06/28/2006 05:23:04 PM: > FYI, > > I've built a universal binary (PPC & Intel) package for python-ldap. > This is a standard Mac OS X installer which does not require > DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages > site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- > macosx10.4.zip. It'd be nice to add that link to the Downloads page. > > Cheers, > -- > Ben > Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 From michael at stroeder.com Sun Jul 2 11:11:44 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sun, 02 Jul 2006 11:11:44 +0200 Subject: Mac OS X Binary Download In-Reply-To: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> References: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> Message-ID: <44A78DD0.8060608@stroeder.com> Ben Gollmer wrote: > > I've built a universal binary (PPC & Intel) package for python-ldap. > This is a standard Mac OS X installer which does not require > DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages > site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- > macosx10.4.zip. It'd be nice to add that link to the Downloads page. Ben, thanks for contributing. I've added a link on the download page. Ciao, Michael From michael at stroeder.com Sun Jul 2 12:25:14 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sun, 02 Jul 2006 12:25:14 +0200 Subject: problem binding to AD with known-good credentials In-Reply-To: <5b7479590606171143h50a674bk50034455b5553240@mail.gmail.com> References: <5b7479590606171143h50a674bk50034455b5553240@mail.gmail.com> Message-ID: <44A79F0A.6080107@stroeder.com> jacob martinson wrote: > > I created a user in AD with search rights and am able to do a simple > bind with the java-based "LDAP Browser" and search/browse the > directory with those credentials. > > When I try to do a simple bind to the directory with python-ldap I > don't get an exception, but when I try to perform the search, I get an > exception indicating I didn't bind successfully: I guess something's wrong in your code. > ldap.OPERATIONS_ERROR: {'info': '00000000: LdapErr: DSID-0C090627, > comment: In order to perform this operation a successful bind must be > completed on the connection., data 0, vece', 'desc': 'Operations > error'} I suspect you're really doing a search before an appropriate bind. > I am attaching the script that generated this exception. Am I missing > something? I'm not going to debug your code especially since it's an incomplete excerpt. Just some hints: > def search_ad(email,password=''): Where is password used? > # Connect to ldap server, retrieve the CN tied to the given email addr > try: > l = ldap.open(ldapconf.host) You should use ldap.initialize(). Look into arguments trace_level and trace_file. (Hmm, docs needs update in this regard.) The output could help you finding the error in sequence and arguments of the LDAP requests you send. Beware: It outputs passwords! > l.simple_bind_s(ldapconf.ldap_user,ldapconf.ldap_pass) Obviously ldapconf.ldap_pass is not argument password above. Another hint: The universal principal name is not always the RFC 822 e-mail address of a user. This depends on your AD / Exchange installation. > ldap_result_id = l.search(ldapconf.base_dn, ldap.SCOPE_SUBTREE, ldapconf.filter, ['cn']) > result_set = [] > while 1: > result_type, result_data = l.result(ldap_result_id, 0) > if (result_data == []): > break > else: > if result_type == ldap.RES_SEARCH_ENTRY: > result_set.append(result_data) > print result_set Style: Any reason why you don't use the simple l.search_s() method call? I wouldn't expect many results. I don't know your LDAP search filter though. Ciao, Michael. From ben at jatosoft.com Sat Jul 1 21:31:03 2006 From: ben at jatosoft.com (Ben Gollmer) Date: Sat, 1 Jul 2006 14:31:03 -0500 Subject: Mac OS X Binary Download In-Reply-To: References: Message-ID: <26636976-ABE5-43ED-8496-F37E43B76F8D@jatosoft.com> On Jul 1, 2006, at 9:56 AM, brad.allen at omsdal.com wrote: > Thanks! Do you also have one for the Python 2.3.5 that comes > bundled with > Mac OS X? Not ATM, although I could whip one up if you like. Also note that these packages are built on "stock" 10.4, so they don't have SASL enabled (Apple doesn't ship SASL libs or headers with their developer tools). -- Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: -------------- next part -------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 From michael at stroeder.com Wed Jul 5 13:07:51 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Wed, 05 Jul 2006 13:07:51 +0200 Subject: Mac OS X Binary Download In-Reply-To: References: Message-ID: <44AB9D87.8060103@stroeder.com> brad.allen at omsdal.com wrote: > > Hm...without SASL is there any other way to perform secure LDAP > authentication using Python-ldap? You could use simple bind (with clear-text password) over SSL/TLS. > My goal is to find a way in Python to securely authenticate against > an Active Directory. SASL/GSSAPI you need to compile python-ldap with SASL support off course. > It would be even better if the > script could obtain a Kerberos ticket, so the ticket could be passed > to a server app for inspection. kinit is called by the user before using your application (to achieve SSO). On Windows that's another story. Maybe you're better off using win32all with ADSI there. Ciao, Michael. From brad.allen at omsdal.com Mon Jul 3 18:25:10 2006 From: brad.allen at omsdal.com (brad.allen at omsdal.com) Date: Mon, 3 Jul 2006 11:25:10 -0500 Subject: Mac OS X Binary Download In-Reply-To: <26636976-ABE5-43ED-8496-F37E43B76F8D@jatosoft.com> Message-ID: Ben Gollmer wrote on 07/01/2006 02:31:03 PM: > On Jul 1, 2006, at 9:56 AM, brad.allen at omsdal.com wrote: > > > Thanks! Do you also have one for the Python 2.3.5 that comes > > bundled with > > Mac OS X? > > Not ATM, although I could whip one up if you like. Also note that > these packages are built on "stock" 10.4, so they don't have SASL > enabled (Apple doesn't ship SASL libs or headers with their developer > tools). Hm...without SASL is there any other way to perform secure LDAP authentication using Python-ldap? My goal is to find a way in Python to securely authenticate against an Active Directory. The user will enter their username/password into a PythonCard GUI and then Python will try that username and password against the Active Directory. It would be even better if the script could obtain a Kerberos ticket, so the ticket could be passed to a server app for inspection. That way, the server app could trust that the client is who it claims to be. However, Kerberos programming is a bit above my head right now, so for now secure LDAP authentication would be nice. If anyone on this list is interested in a consulting gig to help me figure this out, please contact me off-list. Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 From brinerlist at gmail.com Fri Jul 7 14:06:53 2006 From: brinerlist at gmail.com (Cedric Briner) Date: Fri, 7 Jul 2006 14:06:53 +0200 Subject: huge among of time to bind Message-ID: <4fdc46710607070506q7060c26by872bf6a5c88b963a@mail.gmail.com> debian/etch model name : Intel(R) Pentium(R) 4 CPU 2.40GHz hello, It takes about 45 seconds to bind to an ldap server using this code. ``top'' shows that in works a 100 % percent of its capacities during this 45 sec. I also checked the network usage without seeing any big transfer of data (using the gnome applet to watch the resources) Am I doing something wrong in this code ??? code ------ import ldap ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW) ldap.set_option(ldap.OPT_X_TLS_CACERTDIR,'/etc/ssl/certs/') l = ldap.initialize('ldaps://newpeople.unige.ch:636') username='cn=observatoire agent,ou=observatoire,ou=Applications,dc=unige,dc=ch' password = "not_copied" # this is the line which takes 45 secs ? l.bind_s(username,password,ldap.AUTH_SIMPLE) thx in advance for any hints . Ced. Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 From michael at stroeder.com Sat Jul 8 10:59:51 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sat, 08 Jul 2006 10:59:51 +0200 Subject: huge among of time to bind In-Reply-To: <4fdc46710607070506q7060c26by872bf6a5c88b963a@mail.gmail.com> References: <4fdc46710607070506q7060c26by872bf6a5c88b963a@mail.gmail.com> Message-ID: <44AF7407.90304@stroeder.com> Cedric Briner wrote: > debian/etch This does not mean anything to me. Please always provide version numbers of python-ldap and OpenLDAP libs. > It takes about 45 seconds to bind to an ldap server using this code. I suspect something related to DNS timeouts due to misconfiguration. Ciao, Michael. From michael at stroeder.com Mon Jul 10 11:01:49 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Mon, 10 Jul 2006 11:01:49 +0200 Subject: huge among of time to bind In-Reply-To: <4fdc46710607100121n767259a5gee2d557b33bd6775@mail.gmail.com> References: <4fdc46710607070506q7060c26by872bf6a5c88b963a@mail.gmail.com> <44AF7407.90304@stroeder.com> <4fdc46710607100121n767259a5gee2d557b33bd6775@mail.gmail.com> Message-ID: <44B2177D.8060803@stroeder.com> Cedric Briner wrote: > > I've done a strace -f of my applications > and I've seen that the application was spending a lot of time > reading/analysing the /etc/ssl/certs files. > so I've remove all the files in /etc/ssl/certs/ except the one I use. That's an OpenSSL issue. You have to create hash symlinks to the CA certs. See OpenSSL docs. Ciao, Michael. From ben at jatosoft.com Sat Jul 15 06:56:32 2006 From: ben at jatosoft.com (Ben Gollmer) Date: Fri, 14 Jul 2006 23:56:32 -0500 Subject: Mac OS X Binary Download In-Reply-To: <44A78DD0.8060608@stroeder.com> References: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> <44A78DD0.8060608@stroeder.com> Message-ID: <8F42C61D-492B-45F9-89A6-A19F3FCAF02E@jatosoft.com> On Jul 2, 2006, at 4:11 AM, Michael Str?der wrote: > Ben Gollmer wrote: >> >> I've built a universal binary (PPC & Intel) package for python-ldap. >> This is a standard Mac OS X installer which does not require >> DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages >> site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- >> macosx10.4.zip. It'd be nice to add that link to the Downloads page. > > Ben, thanks for contributing. I've added a link on the download page. Thanks! Unfortunately the link on that page is broken. The correct URL is as follows: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- macosx10.4.zip Cheers, -- Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From michael at stroeder.com Sat Jul 15 23:54:26 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sat, 15 Jul 2006 23:54:26 +0200 Subject: Mac OS X Binary Download In-Reply-To: <8F42C61D-492B-45F9-89A6-A19F3FCAF02E@jatosoft.com> References: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> <44A78DD0.8060608@stroeder.com> <8F42C61D-492B-45F9-89A6-A19F3FCAF02E@jatosoft.com> Message-ID: <44B96412.10105@stroeder.com> Ben Gollmer wrote: > On Jul 2, 2006, at 4:11 AM, Michael Str?der wrote: > >> Ben Gollmer wrote: >> >>> >>> I've built a universal binary (PPC & Intel) package for python-ldap. >>> This is a standard Mac OS X installer which does not require >>> DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages >>> site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- >>> macosx10.4.zip. It'd be nice to add that link to the Downloads page. >> >> >> Ben, thanks for contributing. I've added a link on the download page. > > > Thanks! Unfortunately the link on that page is broken. The correct URL > is as follows: > > http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- > macosx10.4.zip The problem is that you are posting the URL with a space. But even if I omit the space I can't figure out what's the right URL. Maybe the URL on http://pythonmac.org/packages/py24-fat/ is also wrong? $ wget "http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- macosx10.4.zip" --23:50:55-- http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4-%20macosx10.4.zip => `python_ldap-2.2.0-py2.4- macosx10.4.zip' Resolving pythonmac.org... 66.33.220.150 Connecting to pythonmac.org|66.33.220.150|:80... connected. HTTP request sent, awaiting response... 404 Not Found 23:50:56 ERROR 404: Not Found. $ wget "http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4-macosx10.4.zip" --23:51:00-- http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4-macosx10.4.zip => `python_ldap-2.2.0-py2.4-macosx10.4.zip' Resolving pythonmac.org... 66.33.220.150 Connecting to pythonmac.org|66.33.220.150|:80... connected. HTTP request sent, awaiting response... 404 Not Found 23:51:00 ERROR 404: Not Found. Ciao, Michael. From ben at jatosoft.com Sun Jul 16 03:09:40 2006 From: ben at jatosoft.com (Ben Gollmer) Date: Sat, 15 Jul 2006 20:09:40 -0500 Subject: Mac OS X Binary Download In-Reply-To: <44B96412.10105@stroeder.com> References: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> <44A78DD0.8060608@stroeder.com> <8F42C61D-492B-45F9-89A6-A19F3FCAF02E@jatosoft.com> <44B96412.10105@stroeder.com> Message-ID: <98F3838E-2586-4A5C-B3BE-E0394B781F1F@jatosoft.com> On Jul 15, 2006, at 4:54 PM, Michael Str?der wrote: > The problem is that you are posting the URL with a space. But even > if I > omit the space I can't figure out what's the right URL. Sorry, it must be my mailer wrapping the URL. > Maybe the URL on http://pythonmac.org/packages/py24-fat/ is also > wrong? It is correct - at least it worked when I initially sent the package there, although now the file seems to have been moved. I'll check with the maintainer of that server and see what happened. -- Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From raphael.pesche at rz.uni-freiburg.de Tue Jul 18 09:30:59 2006 From: raphael.pesche at rz.uni-freiburg.de (Raphael Pesche) Date: Tue, 18 Jul 2006 09:30:59 +0200 Subject: compiling with kubuntu Message-ID: <44BC8E33.3070609@rz.uni-freiburg.de> Hi, I'm desperatly trying to compile python-ldap-2.2.0 on kubuntu 6.06 with python-2.3.5. OpenLDAP, OpenSSL and SASL are installed. I get the error: Modules/errors.c:24 error: size of array 'errobjects' is negative error: command 'gcc' failed with exit status 1 excerpt of my setup.cfg: library_dirs = /usr/lib /usr/lib/sasl2 include_dirs = /usr/include/sasl libs = ldap lber resolv I tried also: libs = ldap_r lber sasl2 ssl crypto any hints as how to get it working? Thanks, Raphael From vela at debian.org Tue Jul 18 11:25:35 2006 From: vela at debian.org (Matej Vela) Date: Tue, 18 Jul 2006 11:25:35 +0200 Subject: compiling with kubuntu In-Reply-To: <44BC8E33.3070609@rz.uni-freiburg.de> (Raphael Pesche's message of "Tue, 18 Jul 2006 09:30:59 +0200") References: <44BC8E33.3070609@rz.uni-freiburg.de> Message-ID: <87k66b9sds.fsf@debian.org> Raphael Pesche writes: > I'm desperatly trying to compile python-ldap-2.2.0 on kubuntu 6.06 with > python-2.3.5. > OpenLDAP, OpenSSL and SASL are installed. > I get the error: > > Modules/errors.c:24 error: size of array 'errobjects' is negative > error: command 'gcc' failed with exit status 1 > [...] > > any hints as how to get it working? Modules/errors.c requires a small patch for OpenLDAP 2.1 compatibility (attached). It's included in source packages for edgy [1] and etch [2]. [1] [2] You're probably wondering why we still use OpenLDAP 2.1 libraries. AFAIK, it's because of libnss-ldap -- on partially-upgraded systems, libnss-ldap might be linked to one version of OpenLDAP, and the application to another, usually resulting in mixed-up symbols and a spectacular crash. I think the current plan is to solve this through symbol versioning, though I'm not sure it will make it to this year's Debian (or Ubuntu) release. (Note that this doesn't affect the slapd package, which is already OpenLDAP 2.3.) Cheers, Matej -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: openldap_2.1.diff URL: From michele.marcionelli at math.ethz.ch Thu Jul 20 11:33:58 2006 From: michele.marcionelli at math.ethz.ch (Michele Marcionelli) Date: Thu, 20 Jul 2006 11:33:58 +0200 Subject: _ldap.so: undefined symbol: ber_flatten2 Message-ID: Hello, Python 2.3.5 OpenLDAP 2.0.27 python-ldap-2.0.11 I can build (with some warnings - see attachment) and install python- ldap but when I try to "import ldap" I get the following error message: Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/ldap/__init__.py", line 23, in ? from _ldap import * ImportError: /usr/local/lib/python2.3/site-packages/_ldap.so: undefined symbol: ber_flatten2 What is wrong? It sould also be possible to use OpenLDAP 2.0 (not only 2.1)? Help needed ;-) Regards, Michele -- ETH Z?rich Michele Marcionelli IT Support Gruppe D-MATH HG G 18 R?mistrasse 101 CH?8092 Z?rich michele.marcionelli at math.ethz.ch http://www.math.ethz.ch/~michele +41 44 632 6193 Telefon +41 44 632 1404 Fax From michele.marcionelli at math.ethz.ch Thu Jul 20 11:38:32 2006 From: michele.marcionelli at math.ethz.ch (Michele Marcionelli) Date: Thu, 20 Jul 2006 11:38:32 +0200 Subject: _ldap.so: undefined symbol: ber_flatten2 Message-ID: <9C3BEB6C-0F5A-4240-8F36-3C01B2882E9E@math.ethz.ch> ** with attachments ** Hello, Python 2.3.5 OpenLDAP 2.0.27 python-ldap-2.0.11 I can build (with some warnings - see attachment) and install python- ldap but when I try to "import ldap" I get the following error message: Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/ldap/__init__.py", line 23, in ? from _ldap import * ImportError: /usr/local/lib/python2.3/site-packages/_ldap.so: undefined symbol: ber_flatten2 What is wrong? It sould also be possible to use OpenLDAP 2.0 (not only 2.1)? Help needed ;-) Regards, Michele -------------- next part -------------- A non-text attachment was scrubbed... Name: build.out Type: application/octet-stream Size: 6748 bytes Desc: not available URL: -------------- next part -------------- -- ETH Z?rich Michele Marcionelli IT Support Gruppe D-MATH HG G 18 R?mistrasse 101 CH?8092 Z?rich michele.marcionelli at math.ethz.ch http://www.math.ethz.ch/~michele +41 44 632 6193 Telefon +41 44 632 1404 Fax From michael at stroeder.com Thu Jul 20 13:11:24 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Thu, 20 Jul 2006 13:11:24 +0200 Subject: _ldap.so: undefined symbol: ber_flatten2 In-Reply-To: <9C3BEB6C-0F5A-4240-8F36-3C01B2882E9E@math.ethz.ch> References: <9C3BEB6C-0F5A-4240-8F36-3C01B2882E9E@math.ethz.ch> Message-ID: <44BF64DC.9030105@stroeder.com> Michele Marcionelli wrote: > > OpenLDAP 2.0.27 > python-ldap-2.0.11 > [..] > ImportError: /usr/local/lib/python2.3/site-packages/_ldap.so: undefined > symbol: ber_flatten2 > [..] > What is wrong? It sould also be possible to use OpenLDAP 2.0 (not only > 2.1)? Hmm, python-ldap 2.0.11 was supposed to work with OpenLDAP 2.0.x but adding a user-contributed patch for LDAPv3 controls used function ber_flatten2(). Obviously this change was not available in the 2.0.11 release yet: http://python-ldap.cvs.sourceforge.net/python-ldap/python-ldap/Modules/ldapcontrol.c?r1=1.3&r2=1.4 Well, since OpenLDAP 2.0.27's libldap is really ancient and very buggy compared to today's versions I'm not keen on supporting this OpenLDAP version anymore. It's really time to upgrade now. Ciao, Michael. From brad.allen at omsdal.com Fri Jul 21 01:34:58 2006 From: brad.allen at omsdal.com (brad.allen at omsdal.com) Date: Thu, 20 Jul 2006 18:34:58 -0500 Subject: Mac OS X Binary Download In-Reply-To: <8BEDAE95-70AF-47B2-8912-734D124CDD17@jatosoft.com> Message-ID: Ben Gollmer wrote on 06/28/2006 05:23:04 PM: > FYI, > > I've built a universal binary (PPC & Intel) package for python-ldap. > This is a standard Mac OS X installer which does not require > DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages > site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- > macosx10.4.zip. It'd be nice to add that link to the Downloads page. The link for this appears to be currently broken...if you browse http://pythonmac.org/packages/py24-fat/ and click the link for python_ldap-2.2.0-py2.4-macosx10.4.zip you get a broken URL: http://pythonmac.org/packages/py24-fat/dmg/wxPython2.6-osx-unicode-2.6.3.3-universal10.4-py2.4.dmg From bob at redivi.com Fri Jul 21 01:46:36 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 16:46:36 -0700 Subject: Mac OS X Binary Download In-Reply-To: References: Message-ID: <29B92D3B-C97E-4A72-8DDB-F158C72C1A52@redivi.com> On Jul 20, 2006, at 4:34 PM, brad.allen at omsdal.com wrote: > Ben Gollmer wrote on 06/28/2006 05:23:04 PM: > >> FYI, >> >> I've built a universal binary (PPC & Intel) package for python-ldap. >> This is a standard Mac OS X installer which does not require >> DarwinPorts or Fink. It's hosted at Bob Ippolito's PythonMac packages >> site: http://pythonmac.org/packages/py24-fat/python_ldap-2.2.0-py2.4- >> macosx10.4.zip. It'd be nice to add that link to the Downloads page. > > The link for this appears to be currently broken...if you browse > http://pythonmac.org/packages/py24-fat/ and click the link for > python_ldap-2.2.0-py2.4-macosx10.4.zip you get a broken URL: fixed now, it was missing the "mpkg/" part > http://pythonmac.org/packages/py24-fat/dmg/wxPython2.6-osx- > unicode-2.6.3.3-universal10.4-py2.4.dmg It definitely wasn't set to that, nor was that URL broken... -bob From tmclaugh at sdf.lonestar.org Mon Aug 14 17:17:14 2006 From: tmclaugh at sdf.lonestar.org (Tom McLaughlin) Date: Mon, 14 Aug 2006 15:17:14 -0000 (UTC) Subject: [patch] fix get_option() crash, make more OPT_X_SASL_* info available. Message-ID: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> Hi, the attached patch is to fix a crash I found with py-ldap when using get_option() and to allow getting more OPT_X_SASL_* information with get_option(). 1) The second to last hunk fixes a crash when using get_option() and the constant returns a NULL. I can repeat this crash on FreeBSD with python 2.4.3 / py-ldap 2.2.0 / openldap 2.3.24 and on CentOS with python 2.3.4 / py-ldap 2.0.1 / openldap 2.2.13. To recreate: (without TLS_CERT defined in ldap.conf || ~/.ldaprc) >>> ldap.get_option(ldap.OPT_X_TLS_CERTFILE) Result: Segfault Backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x811f000 (LWP 100124)] 0x0807779a in PyString_FromString (str=0x0) at /usr/ports/lang/python/work/Python-2.4.3/Objects/stringobject.c:106 106 size = strlen(str); (gdb) bt full #0 0x0807779a in PyString_FromString (str=0x0) at /usr/ports/lang/python/work/Python-2.4.3/Objects/stringobject.c:106 size = 0 op = (PyStringObject *) 0x2838f448 #1 0x2838d68b in LDAP_get_option (self=0x0, option=0) at Modules/options.c:237 res = 0 intval = 673302330 tv = {tv_sec = 0, tv_usec = 135372032} apiinfo = {ldapai_info_version = 0, ldapai_api_version = 0, ldapai_protocol_version = 0, ldapai_extensions = 0x2838f448, ldapai_vendor_name = 0x81b0acc "\002", ldapai_vendor_version = 136047500} lcs = (LDAPControl **) 0x2821cdca lc = (LDAPControl *) 0x0 strval = 0x0 extensions = (PyObject *) 0xbfbfe3c8 v = (PyObject *) 0x811f048 tup = (PyObject *) 0x0 i = 0 num_extensions = 0 num_controls = 0 ld = (LDAP *) 0x0 #2 0x2838c298 in l_ldap_get_option (self=0x0, args=0x81b45ec) at Modules/functions.c:117 option = 24580 #3 0x0805a7dc in PyObject_Call (func=0xffffffff, arg=0x81b45ec, kw=0x825302c) at /usr/ports/lang/python/work/Python-2.4.3/Objects/abstract.c:1795 result = (PyObject *) 0x81b45ec call = 0 #4 0x0809d8ee in PyEval_EvalFrame (f=0x8168e0c) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:3843 s = (Py_UNICODE *) 0x81beb8c len = 135989964 stack_pointer = (PyObject **) 0x8168f78 next_instr = (unsigned char *) 0x82290a2 "}\004" opcode = -1 oparg = 135989964 why = WHY_NOT err = 0 x = (PyObject *) 0x825302c v = (PyObject *) 0x81b45ec w = (PyObject *) 0x81b4f80 u = (PyObject *) 0x81beb8c t = (PyObject *) 0x81b0acc stream = (PyObject *) 0x0 fastlocals = (PyObject **) 0x8168f58 freevars = (PyObject **) 0x8168f6c retval = (PyObject *) 0x0 tstate = (PyThreadState *) 0x8117800 co = (PyCodeObject *) 0x81b9860 instr_ub = -1 instr_lb = 0 instr_prev = -1 first_instr = (unsigned char *) 0x8229014 "t" names = (PyObject *) 0x812dabc consts = (PyObject *) 0x816589c #5 0x0809ff28 in PyEval_EvalCodeEx (co=0x81b9860, globals=0x0, locals=0x0, args=0x81b9860, argcount=2, kws=0x8186968, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:2739 tmp = (PyObject *) 0xffffffff f = (PyFrameObject *) 0x8168e0c retval = (PyObject *) 0x0 fastlocals = (PyObject **) 0x8168f58 freevars = (PyObject **) 0x8168f6c tstate = (PyThreadState *) 0x8117800 x = (PyObject *) 0x0 u = (PyObject *) 0x81b0acc #6 0x0809e535 in PyEval_EvalFrame (f=0x818680c) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:3658 a = 0 b = 0 res = 0 stack_pointer = (PyObject **) 0x8186968 next_instr = (unsigned char *) 0x81cbc23 "S" opcode = -1 oparg = 136135372 why = WHY_NOT err = 0 x = (PyObject *) 0x821b2d4 v = (PyObject *) 0x81cc9bc w = (PyObject *) 0x81b5c00 u = (PyObject *) 0x2 t = (PyObject *) 0x81d42cc stream = (PyObject *) 0x0 fastlocals = (PyObject **) 0x8186958 freevars = (PyObject **) 0x818695c retval = (PyObject *) 0x0 tstate = (PyThreadState *) 0x8117800 co = (PyCodeObject *) 0x81c4260 instr_ub = -1 instr_lb = 0 instr_prev = -1 first_instr = (unsigned char *) 0x81cbc14 "t" names = (PyObject *) 0x81c38ec consts = (PyObject *) 0x81cafcc #7 0x0809f6fd in PyEval_EvalFrame (f=0x816ec0c) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:3648 retval = (PyObject *) 0xffffffec fastlocals = (PyObject **) 0x8186958 i = 1 f = (PyFrameObject *) 0x818680c tstate = (PyThreadState *) 0x8117800 stack = (PyObject **) 0x0 stack_pointer = (PyObject **) 0x816ed60 next_instr = (unsigned char *) 0x81c7763 "Fd" opcode = -1 oparg = 136651076 why = WHY_NOT err = 0 x = (PyObject *) 0x821b2d4 v = (PyObject *) 0x818680c w = (PyObject *) 0x81acfb0 u = (PyObject *) 0x8186958 t = (PyObject *) 0x8252144 stream = (PyObject *) 0x0 fastlocals = (PyObject **) 0x816ed58 freevars = (PyObject **) 0x816ed58 retval = (PyObject *) 0x0 tstate = (PyThreadState *) 0x8117800 co = (PyCodeObject *) 0x81ae5e0 instr_ub = -1 instr_lb = 0 instr_prev = -1 first_instr = (unsigned char *) 0x81c7754 "e" names = (PyObject *) 0x81bc7fc consts = (PyObject *) 0x814c6ac #8 0x0809ff28 in PyEval_EvalCodeEx (co=0x81ae5e0, globals=0x0, locals=0x0, args=0x81ae5e0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:2739 tmp = (PyObject *) 0xffffffff f = (PyFrameObject *) 0x816ec0c retval = (PyObject *) 0x0 fastlocals = (PyObject **) 0x816ed58 freevars = (PyObject **) 0x816ed58 tstate = (PyThreadState *) 0x8117800 x = (PyObject *) 0x0 u = (PyObject *) 0x0 #9 0x080a00c2 in PyEval_EvalCode (co=0x81ae5e0, globals=0x813e824, locals=0x813e824) at /usr/ports/lang/python/work/Python-2.4.3/Python/ceval.c:487 No locals. #10 0x080b79de in run_node (n=0x81265a8, filename=0x0, globals=0x813e824, locals=0x813e824, flags=0xbfbfeb18) at /usr/ports/lang/python/work/Python-2.4.3/Python/pythonrun.c:1265 co = (PyCodeObject *) 0x81ae5e0 v = (PyObject *) 0x81265a8 #11 0x080b8be9 in PyRun_InteractiveOneFlags (fp=0x282faac0, filename=0x80d9b7c "", flags=0xbfbfeb18) at /usr/ports/lang/python/work/Python-2.4.3/Python/pythonrun.c:762 m = (PyObject *) 0x0 d = (PyObject *) 0x0 v = (PyObject *) 0x81b4a20 w = (PyObject *) 0x81b4d60 n = (node *) 0x81265a8 err = {error = 16, filename = 0x80d9b7c "", lineno = 0, offset = 0, text = 0x0, token = -1, expected = -1} ps1 = 0x81b4a34 ">>> " ps2 = 0x81265a8 "8f\022\bP\217\021\b" #12 0x080b8d27 in PyRun_InteractiveLoopFlags (fp=0x282faac0, filename=0x80d9b7c "", flags=0xbfbfeb18) at /usr/ports/lang/python/work/Python-2.4.3/Python/pythonrun.c:695 v = (PyObject *) 0x81b4d60 ret = 0 local_flags = {cf_flags = 135422044} #13 0x080b9235 in PyRun_AnyFileExFlags (fp=0x282faac0, filename=0x80d9b7c "", closeit=0, flags=0xbfbfeb18) at /usr/ports/lang/python/work/Python-2.4.3/Python/pythonrun.c:658 err = 135109500 #14 0x08055a41 in Py_Main (argc=0, argv=0xbfbfec48) at /usr/ports/lang/python/work/Python-2.4.3/Modules/main.c:493 v = (PyObject *) 0x0 c = 0 sts = 0 command = 0x0 filename = 0x0 module = 0x0 fp = (FILE *) 0x282faac0 p = 0x0 inspect = 0 unbuffered = 0 skipfirstline = 0 stdin_is_interactive = 1 help = 0 version = 0 saw_inspect_flag = 0 saw_unbuffered_flag = 0 cf = {cf_flags = 0} #15 0x0805504d in main (argc=1, argv=0xbfbfec48) at /usr/ports/lang/python/work/Python-2.4.3/Modules/python.c:23 2) I wanted to be able to get a user's SASL_MECH, SASL_AUTHCID, and SASL_AUTHZID but that information wasn't available through py-ldap... So I made it available. :) Other than adding more SASL constants to Modules/options.c, I made LDAP_OPT_X_SASL_SECPROPS return Py_None with LDAP_get_option() because according to ldap.h it is read only. Trying to get ldap.OPT_X_SASL_SECPROPS was returning ldap.SERVER_DOWN for me before even though I had SASL_SECPROPS defined. Please let me know if there are any questions or comments. I don't actually know C... I just kinda figured out the changes. Thanks. tom -- | tmclaugh at sdf.lonestar.org tmclaugh at FreeBSD.org | | FreeBSD http://www.FreeBSD.org | | BSD# http://www.mono-project.com/Mono:FreeBSD | From michael at stroeder.com Mon Aug 14 21:43:31 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Mon, 14 Aug 2006 21:43:31 +0200 Subject: [patch] fix get_option() crash, make more OPT_X_SASL_* info available. In-Reply-To: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> References: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> Message-ID: <44E0D263.1080203@stroeder.com> Tom, thanks for contributing. Tom McLaughlin wrote: > Hi, the attached patch Where's the patch? Ciao, Michael. From troy at metaphorstudio.com Thu Aug 17 06:51:47 2006 From: troy at metaphorstudio.com (Troy Davis) Date: Thu, 17 Aug 2006 00:51:47 -0400 Subject: self.__block.acquire(blocking) hanging Plone instance using LDAP Message-ID: <86AB668F-4774-41FB-9F64-9C6AD2BF4CA3@metaphorstudio.com> Hello Everyone, I've been trying to resolve a deadlock situation on a Plone instance that uses ldap for authentication, and thus python-ldap. The ldap server is on a Fedora Core 2 machine, openldap-servers-2.1.29-1 rpm. It has an SSL cert from GoDaddy, and LDAPUserFolder is configured to use SSL. The system running Plone is Fedora Core 5, python-2.4.3-8.FC5 rpm, and up until tonight I had python-ldap rpm 2.0.6-5.2.1. But I'm hoping that upgrading to 2.2.0 will help, I downloaded and installed it a few minutes ago. Plone is 2.5, zope is 2.9.4-final, LDAPUserFolder 2.7, LDAPMultiPlugins 1.3. Does any of this send up red flags? Here's a traceback I got from zope's DeadlockDebugger: http://rafb.net/paste/results/lHaHty24.html I think the relevant section is here: File "/opt/zope/instance1/Products/LDAPUserFolder/LDAPDelegate.py", line 189, in connect conn.simple_bind_s(user_dn, user_pwd) File "/opt/zope/instance1/Products/LDAPUserFolder/ SharedResource.py", line 110, in __call__ self._lock.acquire() File "/usr/lib/python2.4/threading.py", line 100, in acquire rc = self.__block.acquire(blocking) After doing a little research, I came across the same errors in this message: http://www.dataflake.org/tracker/issue_00423 And that led me to a message from this list last year: http://sourceforge.net/mailarchive/message.php?msg_id=11183313 So I think I've found the right place... Hopefully I'll write in tomorrow saying that the problem is solved and the Plone instance is stable again. If so, I hope this message guides other folks that encounter this problem toward a solution. Crossing fingers & toes, Troy From troy at metaphorstudio.com Thu Aug 17 17:24:03 2006 From: troy at metaphorstudio.com (Troy Davis) Date: Thu, 17 Aug 2006 11:24:03 -0400 Subject: self.__block.acquire(blocking) hanging Plone instance using LDAP Message-ID: Hello, Unfortunately the latest release of python-ldap did not fix the problem I reported last night. The server still goes unresponsive for 10 minutes to an hour at a time randomly, it's happened eight times since my post last night. Unfortunately I may not be able to troubleshoot this for much longer. My client is very upset with the unavailability of the Plone site when these problems occur, and they are considering firing my company and getting someone else to do the work. So if you have any suggestions, this is the time. Thank You, Troy From michael at stroeder.com Sat Aug 26 01:01:49 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sat, 26 Aug 2006 01:01:49 +0200 Subject: self.__block.acquire(blocking) hanging Plone instance using LDAP In-Reply-To: <86AB668F-4774-41FB-9F64-9C6AD2BF4CA3@metaphorstudio.com> References: <86AB668F-4774-41FB-9F64-9C6AD2BF4CA3@metaphorstudio.com> Message-ID: <44EF815D.9070406@stroeder.com> Troy Davis wrote: > > I've been trying to resolve a deadlock situation on a Plone instance > that uses ldap for authentication, and thus python-ldap. The ldap > server is on a Fedora Core 2 machine, openldap-servers-2.1.29-1 rpm. If ancient 2.1.29 is also the version of the OpenLDAP client libs I'd strongly recommend to upgrade. There have been countless fixes to libldap and libldap_r (recommended for multi-threaded apps). You also won't get support for this old OpenLDAP version on the OpenLDAP mailing lists (except recommendation to upgrade). Ciao, Michael. From michael at stroeder.com Sat Aug 26 01:01:49 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Sat, 26 Aug 2006 01:01:49 +0200 Subject: self.__block.acquire(blocking) hanging Plone instance using LDAP In-Reply-To: <86AB668F-4774-41FB-9F64-9C6AD2BF4CA3@metaphorstudio.com> References: <86AB668F-4774-41FB-9F64-9C6AD2BF4CA3@metaphorstudio.com> Message-ID: <44EF815D.9070406@stroeder.com> Troy Davis wrote: > > I've been trying to resolve a deadlock situation on a Plone instance > that uses ldap for authentication, and thus python-ldap. The ldap > server is on a Fedora Core 2 machine, openldap-servers-2.1.29-1 rpm. If ancient 2.1.29 is also the version of the OpenLDAP client libs I'd strongly recommend to upgrade. There have been countless fixes to libldap and libldap_r (recommended for multi-threaded apps). You also won't get support for this old OpenLDAP version on the OpenLDAP mailing lists (except recommendation to upgrade). Ciao, Michael. From bhuvan at collab.net Wed Sep 13 09:34:24 2006 From: bhuvan at collab.net (Bhuvaneswaran Arumugam) Date: Wed, 13 Sep 2006 13:04:24 +0530 Subject: [PATCH] modlist.py: Compare old and new values Message-ID: <1158132865.5722.17.camel@localhost.localdomain> Hello, BUG: Currently you compare the length of old and new values. So, it does not recognize the diff when there is no change in length but the actual string itself is changed (ex: s/usr/var/g). Due to this bug, it returns empty ldif so subsequent call to modify_s (in my application) fails. FIX: Please find attached the patch. [[ Patch by: Bhuvaneswaran Arumugam Lib/ldap/modlist.py: * (modifyModlist): Compare the old and new value instead of their length. When it is compared against the length, it returns empty ldif even though there is difference between old and new value but not in length. ]] -- Regards, Bhuvaneswaran -------------- next part -------------- A non-text attachment was scrubbed... Name: modlist.py.diff Type: text/x-patch Size: 337 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part URL: From michael at stroeder.com Wed Sep 13 10:20:26 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Wed, 13 Sep 2006 10:20:26 +0200 Subject: [PATCH] modlist.py: Compare old and new values In-Reply-To: <1158132865.5722.17.camel@localhost.localdomain> References: <1158132865.5722.17.camel@localhost.localdomain> Message-ID: <4507BF4A.1050605@stroeder.com> Bhuvaneswaran Arumugam wrote: > > BUG: > > Currently you compare the length of old and new values. Judging from your patch you mean the attribute value lists. > So, it does not > recognize the diff when there is no change in length but the actual > string itself is changed (ex: s/usr/var/g). It's not that easy. replace_attr_value can also be set to 1 after line 87. Could you please post an example of the error? Best thing would be to add your errornous case as test-case to Tests/Lib/ldap/test_modlist.py. > Due to this bug, it returns > empty ldif so subsequent call to modify_s (in my application) fails. Hmm, are you using module ldif afterwards to turn the modlist into LDIF? How does the modlist look like. Is it empty? > < replace_attr_value = len(old_value)!=len(new_value) > --- > >> replace_attr_value = old_value!=new_value Please note that old_value and new_value are actually lists of attribute values. This line above sets only a first indicator that an attribute has changed to avoid performance loss due to calling the function list_dict(). Ciao, Michael. From bhuvan at collab.net Wed Sep 13 11:42:20 2006 From: bhuvan at collab.net (Bhuvaneswaran Arumugam) Date: Wed, 13 Sep 2006 15:12:20 +0530 Subject: [PATCH] modlist.py: Compare old and new values In-Reply-To: <4507BF4A.1050605@stroeder.com> References: <1158132865.5722.17.camel@localhost.localdomain> <4507BF4A.1050605@stroeder.com> Message-ID: <1158140540.5722.23.camel@localhost.localdomain> Thanks for your response. Please find my comments and a patch for test_modlist.py script. On Wed, 2006-09-13 at 10:20 +0200, Michael Str?der wrote: > Bhuvaneswaran Arumugam wrote: > > > > BUG: > > > > Currently you compare the length of old and new values. > > Judging from your patch you mean the attribute value lists. Yep. After i went through test_modlist.py cases, i observed it was because i don't use list as the value of ldap key/variable. Please find attached a patch to test_modlist.py script. I've included two test cases viz. 'case 2' (list) and 'case 3' (string). 'case 2' is ok but 'case 3' reports following error: Testing function addModlist(): Testing function modifyModlist(): result_modlist is empty '[]' modifyModlist({'nisMapEntry': '-intr,hard,tcp,rsize=32768,wsize=32768,nfsvers=3 mgr:/u1/chroot//test/grue'},{'nisMapEntry': '-intr,hard,tcp,rsize=32768,wsize=32768,nfsvers=3 mgr:/u1/chroot//test/mrue'}) returns [] instead of [(0, 'nisMapEntry', '-intr,hard,tcp,rsize=32768,wsize=32768,nfsvers=3 mgr:/u1/chroot//test/mrue'), (1, 'nisMapEntry', None)]. But i'm unsure whether it's the intended behavior. > > So, it does not > > recognize the diff when there is no change in length but the actual > > string itself is changed (ex: s/usr/var/g). > > It's not that easy. replace_attr_value can also be set to 1 after line > 87. Could you please post an example of the error? > > Best thing would be to add your errornous case as test-case to > Tests/Lib/ldap/test_modlist.py. > > > Due to this bug, it returns > > empty ldif so subsequent call to modify_s (in my application) fails. > > Hmm, are you using module ldif afterwards to turn the modlist into LDIF? > How does the modlist look like. Is it empty? > > > < replace_attr_value = len(old_value)!=len(new_value) > > --- > > > >> replace_attr_value = old_value!=new_value > > Please note that old_value and new_value are actually lists of attribute > values. This line above sets only a first indicator that an attribute > has changed to avoid performance loss due to calling the function > list_dict(). > > Ciao, Michael. > -- Regards, Bhuvaneswaran -------------- next part -------------- A non-text attachment was scrubbed... Name: test_modlist.py.diff Type: text/x-patch Size: 1248 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part URL: From michael at stroeder.com Wed Sep 13 11:53:25 2006 From: michael at stroeder.com (=?UTF-8?B?TWljaGFlbCBTdHLDtmRlcg==?=) Date: Wed, 13 Sep 2006 11:53:25 +0200 Subject: [PATCH] modlist.py: Compare old and new values In-Reply-To: <1158140540.5722.23.camel@localhost.localdomain> References: <1158132865.5722.17.camel@localhost.localdomain> <4507BF4A.1050605@stroeder.com> <1158140540.5722.23.camel@localhost.localdomain> Message-ID: <4507D515.5010804@stroeder.com> Bhuvaneswaran Arumugam wrote: > > Yep. After i went through test_modlist.py cases, i observed it was > because i don't use list as the value of ldap key/variable. So everything's ok with ldap.modlist.modifyModlist()? Ciao, Michael. From michael at stroeder.com Mon Sep 18 22:45:12 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Mon, 18 Sep 2006 22:45:12 +0200 Subject: Compability issues with Python 2.5 Message-ID: <450F0558.4080203@stroeder.com> HI! I suspect that python-ldap has some issues regarding changes in the C API of Python 2.5. web2ldap with recent python-ldap crashes quite often. Since my C knowledge is quite bad I need some volunteers. Anyone willing to spend some spare time digging under Modules/ is encouraged to read PEP 0353 and "What's New in Python 2.5": http://docs.python.org/dev/whatsnew/ports.html http://docs.python.org/dev/whatsnew/section-other.html (last two items starting with "C API:") http://www.python.org/dev/peps/pep-0353/#conversion-guidelines I've attached a unified patch of my first try to address these issues. But I won't commit them now. Please review. Ciao, Michael. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: python-ldap_pep-0353.1stpatchset URL: From KRJackson at lbl.gov Tue Sep 19 00:25:28 2006 From: KRJackson at lbl.gov (Keith Jackson) Date: Mon, 18 Sep 2006 15:25:28 -0700 Subject: Compability issues with Python 2.5 In-Reply-To: <450F0558.4080203@stroeder.com> References: <450F0558.4080203@stroeder.com> Message-ID: <7CF55B07-98C5-494D-97A5-1971C1345C8B@lbl.gov> I don't have time, but when I converted a bunch of my code I found http://svn.effbot.python-hosting.com/stuff/sandbox/python/ ssizecheck.py to be very useful. --keith On Sep 18, 2006, at 1:45 PM, Michael Str?der wrote: > HI! > > I suspect that python-ldap has some issues regarding changes in the C > API of Python 2.5. web2ldap with recent python-ldap crashes quite > often. > > Since my C knowledge is quite bad I need some volunteers. Anyone > willing > to spend some spare time digging under Modules/ is encouraged to read > PEP 0353 and "What's New in Python 2.5": > > http://docs.python.org/dev/whatsnew/ports.html > > http://docs.python.org/dev/whatsnew/section-other.html (last two items > starting with "C API:") > > http://www.python.org/dev/peps/pep-0353/#conversion-guidelines > > I've attached a unified patch of my first try to address these issues. > But I won't commit them now. Please review. > > Ciao, Michael. > Index: Modules/ldapcontrol.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/ldapcontrol.c,v > retrieving revision 1.5 > diff -u -r1.5 ldapcontrol.c > --- Modules/ldapcontrol.c 10 Apr 2006 05:19:46 -0000 1.5 > +++ Modules/ldapcontrol.c 18 Sep 2006 20:38:08 -0000 > @@ -130,7 +130,7 @@ > LDAPControl** > List_to_LDAPControls( PyObject* list ) > { > - int len, i; > + Py_ssize_t len, i; > LDAPControl** ldcs; > LDAPControl* ldc; > PyObject* item; > @@ -173,7 +173,7 @@ > { > PyObject *res = 0, *pyctrl; > LDAPControl **tmp = ldcs; > - unsigned num_ctrls = 0, i; > + Py_ssize_t num_ctrls = 0, i; > > if (tmp) > while (*tmp++) num_ctrls++; > Index: Modules/LDAPObject.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/LDAPObject.c,v > retrieving revision 1.75 > diff -u -r1.75 LDAPObject.c > --- Modules/LDAPObject.c 18 Apr 2006 11:17:30 -0000 1.75 > +++ Modules/LDAPObject.c 18 Sep 2006 20:38:09 -0000 > @@ -210,7 +210,7 @@ > static LDAPMod** > List_to_LDAPMods( PyObject *list, int no_op ) { > > - int i, len; > + Py_ssize_t i, len; > LDAPMod** lms; > PyObject *item; > > @@ -263,7 +263,7 @@ > attrs_from_List( PyObject *attrlist, char***attrsp ) { > > char **attrs = NULL; > - int i, len; > + Py_ssize_t i, len; > PyObject *item; > > if (attrlist == Py_None) { > Index: Modules/options.c > =================================================================== > RCS file: /cvsroot/python-ldap/python-ldap/Modules/options.c,v > retrieving revision 1.15 > diff -u -r1.15 options.c > --- Modules/options.c 11 Mar 2006 21:11:40 -0000 1.15 > +++ Modules/options.c 18 Sep 2006 20:38:09 -0000 > @@ -156,7 +156,7 @@ > LDAPControl *lc; > char *strval; > PyObject *extensions, *v, *tup; > - int i, num_extensions, num_controls; > + Py_ssize_t i, num_extensions, num_controls; > LDAP *ld; > > ld = self ? self->ldap : NULL; > From michael at stroeder.com Tue Sep 19 07:16:21 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Tue, 19 Sep 2006 07:16:21 +0200 Subject: Compability issues with Python 2.5 In-Reply-To: <7CF55B07-98C5-494D-97A5-1971C1345C8B@lbl.gov> References: <450F0558.4080203@stroeder.com> <7CF55B07-98C5-494D-97A5-1971C1345C8B@lbl.gov> Message-ID: <450F7D25.5010807@stroeder.com> Keith Jackson wrote: > I don't have time, but when I converted a bunch of my code I found > http://svn.effbot.python-hosting.com/stuff/sandbox/python/ ssizecheck.py > to be very useful. Yes, it is. I already checked the code with it. But mainly it does only search for function names of the C API. I also don't have a 64-bit machine at hand with decent tool chain. So I won't see compiler warnings on my local system (SuSE Linux 10.0 i386). And in some cases I don't know what to do. E.g. when converting to OpenLDAP's struct berval (handling the length of the berval string). Hmm, to me it looks ok. >From OpenLDAP's lber_types.h: ------------------------------ snip ------------------------------ /* LBER lengths (32 bits or larger) */ #define LBER_LEN_T long [..] /* lengths */ typedef unsigned LBER_LEN_T ber_len_t; ------------------------------ snip ------------------------------ >From OpenLDAP's lber_types.h: ------------------------------ snip ------------------------------ /* structure for returning a sequence of octet strings + length */ typedef struct berval { ber_len_t bv_len; char *bv_val; } BerValue; ------------------------------ snip ------------------------------ Ciao, Michael. From michael at stroeder.com Mon Sep 25 16:55:46 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Mon, 25 Sep 2006 16:55:46 +0200 Subject: [patch] fix get_option() crash, make more OPT_X_SASL_* info available. In-Reply-To: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> References: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> Message-ID: <4517EDF2.8040607@stroeder.com> Tom, thanks for contributing. Sorry for my late reply. My to do list is out of control. Could you please provide two separate patches I could commit separately? Could you please check whether python-ldap still builds with OpenLDAP 2.2.x with your patches? Thanks in advance. Ciao, Michael. Tom McLaughlin wrote: > Hi, the attached patch is to fix a crash I found with py-ldap when using > get_option() and to allow getting more OPT_X_SASL_* information with > get_option(). > > 1) The second to last hunk fixes a crash when using get_option() and the > constant returns a NULL. I can repeat this crash on FreeBSD with python > 2.4.3 / py-ldap 2.2.0 / openldap 2.3.24 and on CentOS with python 2.3.4 / > py-ldap 2.0.1 / openldap 2.2.13. > [..] > 2) I wanted to be able to get a user's SASL_MECH, SASL_AUTHCID, and > SASL_AUTHZID but that information wasn't available through py-ldap... So > I made it available. :) Other than adding more SASL constants to > Modules/options.c, I made LDAP_OPT_X_SASL_SECPROPS return Py_None with > LDAP_get_option() because according to ldap.h it is read only. Trying to > get ldap.OPT_X_SASL_SECPROPS was returning ldap.SERVER_DOWN for me before > even though I had SASL_SECPROPS defined. > > Please let me know if there are any questions or comments. I don't > actually know C... I just kinda figured out the changes. Thanks. > > tom From tmclaugh at sdf.lonestar.org Mon Aug 14 22:24:04 2006 From: tmclaugh at sdf.lonestar.org (Tom McLaughlin) Date: Mon, 14 Aug 2006 20:24:04 -0000 (UTC) Subject: [patch] fix get_option() crash, make more OPT_X_SASL_* info available. In-Reply-To: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> References: <19723.192.216.27.32.1155568634.squirrel@192.216.27.32> Message-ID: <30061.192.216.27.32.1155587044.squirrel@192.216.27.32> Hey, I'm retarded... Here's the patch. tom > Hi, the attached patch is to fix a crash I found with py-ldap when using > get_option() and to allow getting more OPT_X_SASL_* information with > get_option(). > > 1) The second to last hunk fixes a crash when using get_option() and the > constant returns a NULL. I can repeat this crash on FreeBSD with python > 2.4.3 / py-ldap 2.2.0 / openldap 2.3.24 and on CentOS with python 2.3.4 / > py-ldap 2.0.1 / openldap 2.2.13. > > To recreate: (without TLS_CERT defined in ldap.conf || ~/.ldaprc) >>>> ldap.get_option(ldap.OPT_X_TLS_CERTFILE) > > Result: > Segfault > > Backtrace: > > > 2) I wanted to be able to get a user's SASL_MECH, SASL_AUTHCID, and > SASL_AUTHZID but that information wasn't available through py-ldap... So > I made it available. :) Other than adding more SASL constants to > Modules/options.c, I made LDAP_OPT_X_SASL_SECPROPS return Py_None with > LDAP_get_option() because according to ldap.h it is read only. Trying to > get ldap.OPT_X_SASL_SECPROPS was returning ldap.SERVER_DOWN for me before > even though I had SASL_SECPROPS defined. > > Please let me know if there are any questions or comments. I don't > actually know C... I just kinda figured out the changes. Thanks. > > tom > > -- > | tmclaugh at sdf.lonestar.org tmclaugh at FreeBSD.org | > | FreeBSD http://www.FreeBSD.org | > | BSD# http://www.mono-project.com/Mono:FreeBSD | -- | tmclaugh at sdf.lonestar.org tmclaugh at FreeBSD.org | | FreeBSD http://www.FreeBSD.org | | BSD# http://www.mono-project.com/Mono:FreeBSD | -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-Modules_options.c.diff Type: application/octet-stream Size: 2077 bytes Desc: not available URL: From dreamcatcher at users.sf.net Tue Sep 5 03:58:26 2006 From: dreamcatcher at users.sf.net (Sidnei da Silva) Date: Mon, 4 Sep 2006 22:58:26 -0300 Subject: Experimental 2.2.0 Windows Build Message-ID: <20060905015826.GE3986@cotia> Hello there, I've managed to put together an experimental 2.2.0 build for Windows, which can be found here: http://awkly.org/files/python-ldap-2.2.0.win32-py2.4.exe I'm admittedly not an expert in compiling stuff, so if anyone with more expertise can double-check what I've did: http://awkly.org/archive/compiling-python-extensions-on-mingw/ ... specially the change from '-shared' to '-mdll -static' on the arguments to 'ld', I would really *really* appreciate. For the brave folks willing to try out the installer itself, you're at your own risk, but please report back any issues. If the build turns out to work fine and people are willing to bless this as the official Windows build and upload it to sourceforge I would be more than glad. It was built with mingw against: openldap-2.2.29 openssl-0.9.8b -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From michael at stroeder.com Mon Sep 25 16:58:57 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Mon, 25 Sep 2006 16:58:57 +0200 Subject: Experimental 2.2.0 Windows Build In-Reply-To: <20060905015826.GE3986@cotia> References: <20060905015826.GE3986@cotia> Message-ID: <4517EEB1.2050509@stroeder.com> Sidnei, many thanks for contributing this build! I'm sure many people are appreciating it. I had no spare time to test it though. Sidnei da Silva wrote: > > I've managed to put together an experimental 2.2.0 build for Windows, > which can be found here: > > http://awkly.org/files/python-ldap-2.2.0.win32-py2.4.exe > [..] > It was built with mingw against: > > openldap-2.2.29 > openssl-0.9.8b Since OpenLDAP 2.2.x is now considered historic by its developers and OpenSSL contains some security-related bugs would it be possible for you to build with recent versions of both libs? That would be really great. Ciao, Michael. From sidnei at enfoldsystems.com Tue Sep 26 14:43:50 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Tue, 26 Sep 2006 09:43:50 -0300 Subject: Experimental 2.2.0 Windows Build In-Reply-To: <4517EEB1.2050509@stroeder.com> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> Message-ID: <20060926124350.GY4356@cotia> | Since OpenLDAP 2.2.x is now considered historic by its developers and | OpenSSL contains some security-related bugs would it be possible for you | to build with recent versions of both libs? That would be really great. Unfortunately I'm no OpenLDAP guru. I just used the win32 patches from Lucas Bergman available here, which are for the versions I've listed: http://download.bergmans.us/openldap/devel/ I can try to contact Lucas to see if he can provide patches against later versions. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From sidnei at enfoldsystems.com Wed Sep 27 16:47:42 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Wed, 27 Sep 2006 11:47:42 -0300 Subject: Experimental 2.2.0 Windows Build In-Reply-To: <20060926124350.GY4356@cotia> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> <20060926124350.GY4356@cotia> Message-ID: <20060927144742.GJ4340@cotia> On Tue, Sep 26, 2006 at 09:43:50AM -0300, Sidnei da Silva wrote: | Unfortunately I'm no OpenLDAP guru. I just used the win32 patches from Lucas Bergman available here, which are for the versions I've listed: | | http://download.bergmans.us/openldap/devel/ | | I can try to contact Lucas to see if he can provide patches against | later versions. Got a reply. He said new versions of the patches are in the works. Should be available in the coming week(s). On a related note, I would like to setup some testing for python-ldap as part of the pybots [1] project. But apparently it doesn't have much test coverage. Or am I overlooking something? I've tried running the few tests here and some of them fail actually. [1] http://pybots.org/ -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From michael at stroeder.com Wed Sep 27 18:29:05 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Wed, 27 Sep 2006 18:29:05 +0200 Subject: pybots testing In-Reply-To: <20060927144742.GJ4340@cotia> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> <20060926124350.GY4356@cotia> <20060927144742.GJ4340@cotia> Message-ID: <451AA6D1.4060209@stroeder.com> Sidnei da Silva wrote: > > On a related note, I would like to setup some testing for python-ldap > as part of the pybots [1] project. > [1] http://pybots.org/ I'm not familiar with what pybots provide. Glancing over the web page I decided I don't have enough spare time to dig into it. :-( > But apparently it doesn't have much > test coverage. Or am I overlooking something? I've tried running the > few tests here and some of them fail actually. What particular tests are you talking about? What happened when tests failed? Ciao, Michael. From sidnei at enfoldsystems.com Wed Sep 27 19:31:34 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Wed, 27 Sep 2006 14:31:34 -0300 Subject: pybots testing In-Reply-To: <451AA6D1.4060209@stroeder.com> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> <20060926124350.GY4356@cotia> <20060927144742.GJ4340@cotia> <451AA6D1.4060209@stroeder.com> Message-ID: <20060927173134.GM4340@cotia> On Wed, Sep 27, 2006 at 06:29:05PM +0200, Michael Str?der wrote: | I'm not familiar with what pybots provide. Glancing over the web page I | decided I don't have enough spare time to dig into it. :-( Running tests for python-based projects with a debug build of python 2.5 and trunk whenever a checkin happens on the python repository. | > But apparently it doesn't have much | > test coverage. Or am I overlooking something? I've tried running the | > few tests here and some of them fail actually. | | What particular tests are you talking about? | What happened when tests failed? I will collect the output and mail you. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From michael at stroeder.com Wed Sep 27 19:51:51 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Wed, 27 Sep 2006 19:51:51 +0200 Subject: pybots testing In-Reply-To: <20060927173134.GM4340@cotia> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> <20060926124350.GY4356@cotia> <20060927144742.GJ4340@cotia> <451AA6D1.4060209@stroeder.com> <20060927173134.GM4340@cotia> Message-ID: <451ABA37.5060505@stroeder.com> Sidnei da Silva wrote: > On Wed, Sep 27, 2006 at 06:29:05PM +0200, Michael Str?der wrote: > | > | What particular tests are you talking about? > | What happened when tests failed? > > I will collect the output and mail you. Please keep it on the list so it gets archived and can be commented by others too. Ciao, Michael. From sidnei at enfoldsystems.com Wed Sep 27 20:08:42 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Wed, 27 Sep 2006 15:08:42 -0300 Subject: pybots testing In-Reply-To: <20060927173134.GM4340@cotia> References: <20060905015826.GE3986@cotia> <4517EEB1.2050509@stroeder.com> <20060926124350.GY4356@cotia> <20060927144742.GJ4340@cotia> <451AA6D1.4060209@stroeder.com> <20060927173134.GM4340@cotia> Message-ID: <20060927180842.GN4340@cotia> On Wed, Sep 27, 2006 at 02:31:34PM -0300, Sidnei da Silva wrote: | I will collect the output and mail you. So actually looks like it's just one test that's failing. Don't know for sure if I'm finding all of them this way though: C:\src\python-ldap-2.2.0>find . -name '*test*' -print | xargs -I '@' python '@' String: "BLUBBER DI 'BLU'BB ER' DA 'BLAH' " => ['BLUBBER', 'DI', 'BLU', 'BB', 'ER', ' DA ', 'BLAH', ' '] differs from ['BLUBBER', 'DI', "BLU'BB ER", 'DA', 'BLAH'] Testing function addModlist(): Testing function modifyModlist(): Testing function isLDAPUrl(): Testing class LDAPUrl: ######################################################################## ldap://root.openldap.org/dc%3Dopenldap%2Cdc%3Dorg??? Parsing ok Unparsing ok ######################################################################## ldap://root.openldap.org/dc%3Dboolean%2Cdc%3Dnet???%28objectClass%3D%2A%29 Parsing ok Unparsing ok ######################################################################## ldap://root.openldap.org/dc%3Dopenldap%2Cdc%3Dorg??sub? Parsing ok Unparsing ok ######################################################################## ldap://root.openldap.org/dc%3Dopenldap%2Cdc%3Dorg??one? Parsing ok Unparsing ok ######################################################################## ldap://root.openldap.org/dc%3Dopenldap%2Cdc%3Dorg??base? Parsing ok Unparsing ok ######################################################################## ldap://x500.mh.se/o%3DMitthogskolan%2Cc%3Dse????1.2.752.58.10.2=T.61 Parsing ok Unparsing ok ######################################################################## ldap://localhost:12345/dc%3Dstroeder%2Cdc%3Dcom????!bindname=cn=Michael%2Cdc=str oeder%2Cdc=com,!X-BINDPW=secretpassword Parsing ok Unparsing ok ######################################################################## ldap://localhost:54321/dc%3Dstroeder%2Cdc%3Dcom????bindname=cn=Michael%2Cdc=stro eder%2Cdc=com,X-BINDPW=secretpassword Parsing ok Unparsing ok ######################################################################## ldaps://localhost:12345/dc%3Dstroeder%2Cdc%3Dcom??? Parsing ok Unparsing ok ######################################################################## ldapi://%2Ftmp%2Fopenldap2-1389/dc%3Dstroeder%2Cdc%3Dcom??? Parsing ok Unparsing ok -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From whatawonderfulworldweliveintoo at yahoo.com Thu Sep 28 15:15:29 2006 From: whatawonderfulworldweliveintoo at yahoo.com (Ted Johnson) Date: Thu, 28 Sep 2006 06:15:29 -0700 (PDT) Subject: Can't Import LDAP Message-ID: <20060928131529.5961.qmail@web58406.mail.re3.yahoo.com> Hi; I'm on FreeBSD 6.1. I've successfully installed OpenLDAP from the port (I can issue commands to the s/w at the prompt) and it appears I've done the same with py-ldap2 (don't know what commands to issue, but FreeBSD says the s/w was loaded successfully). However, when I fire up my Python interpreter and enter "import ldap" I'm told no such module exists. What could I be doing wrong? TIA. Ted 2 --------------------------------- Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From delphij at delphij.net Thu Sep 28 15:48:27 2006 From: delphij at delphij.net (LI Xin) Date: Thu, 28 Sep 2006 21:48:27 +0800 Subject: Can't Import LDAP In-Reply-To: <20060928131529.5961.qmail@web58406.mail.re3.yahoo.com> References: <20060928131529.5961.qmail@web58406.mail.re3.yahoo.com> Message-ID: <451BD2AB.1060100@delphij.net> Hi, Ted, Ted Johnson wrote: > Hi; > I'm on FreeBSD 6.1. I've successfully installed OpenLDAP from the port > (I can issue commands to the s/w at the prompt) and it appears I've done > the same with py-ldap2 (don't know what commands to issue, but FreeBSD > says the s/w was loaded successfully). However, when I fire up my Python > interpreter and enter "import ldap" I'm told no such module exists. > What could I be doing wrong? I do use py-ldap2 on FreeBSD a lot, and I think I have did a good job on the port ;-) so I would like to help out. Which python release do you use? Will you please check the output of 'pkg_info -L py24-ldap2-2.2.0' to confirm that it has installed the stuff into your python installation's site-packages/ directory? Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: From whatawonderfulworldweliveintoo at yahoo.com Thu Sep 28 16:59:32 2006 From: whatawonderfulworldweliveintoo at yahoo.com (Ted Johnson) Date: Thu, 28 Sep 2006 07:59:32 -0700 (PDT) Subject: Can't Import LDAP In-Reply-To: <451BD2AB.1060100@delphij.net> Message-ID: <20060928145932.14971.qmail@web58413.mail.re3.yahoo.com> 2 LI Xin wrote: Hi, Ted, Ted Johnson wrote: > Hi; > I'm on FreeBSD 6.1. I've successfully installed OpenLDAP from the port > (I can issue commands to the s/w at the prompt) and it appears I've done > the same with py-ldap2 (don't know what commands to issue, but FreeBSD > says the s/w was loaded successfully). However, when I fire up my Python > interpreter and enter "import ldap" I'm told no such module exists. > What could I be doing wrong? I do use py-ldap2 on FreeBSD a lot, and I think I have did a good job on the port ;-) so I would like to help out. Which python release do you use? 2.3.5 Will you please check the output of 'pkg_info -L py24-ldap2-2.2.0' to confirm that it has installed the stuff into your python installation's site-packages/ directory? Here it is, thanks for your help, and TIA for any further direction you can provide. Ted server167# pkg_info -L py24-ldap2-2.2.0 Information for py24-ldap2-2.2.0: Files: /usr/local/lib/python2.4/site-packages/dsml.py /usr/local/lib/python2.4/site-packages/dsml.pyc /usr/local/lib/python2.4/site-packages/dsml.pyo /usr/local/lib/python2.4/site-packages/ldap/__init__.py /usr/local/lib/python2.4/site-packages/ldap/__init__.pyc /usr/local/lib/python2.4/site-packages/ldap/__init__.pyo /usr/local/lib/python2.4/site-packages/ldap/async.py /usr/local/lib/python2.4/site-packages/ldap/async.pyc /usr/local/lib/python2.4/site-packages/ldap/async.pyo /usr/local/lib/python2.4/site-packages/ldap/cidict.py /usr/local/lib/python2.4/site-packages/ldap/cidict.pyc /usr/local/lib/python2.4/site-packages/ldap/cidict.pyo /usr/local/lib/python2.4/site-packages/ldap/controls.py /usr/local/lib/python2.4/site-packages/ldap/controls.pyc /usr/local/lib/python2.4/site-packages/ldap/controls.pyo /usr/local/lib/python2.4/site-packages/ldap/dn.py /usr/local/lib/python2.4/site-packages/ldap/dn.pyc /usr/local/lib/python2.4/site-packages/ldap/dn.pyo /usr/local/lib/python2.4/site-packages/ldap/filter.py /usr/local/lib/python2.4/site-packages/ldap/filter.pyc /usr/local/lib/python2.4/site-packages/ldap/filter.pyo /usr/local/lib/python2.4/site-packages/ldap/functions.py /usr/local/lib/python2.4/site-packages/ldap/functions.pyc /usr/local/lib/python2.4/site-packages/ldap/functions.pyo /usr/local/lib/python2.4/site-packages/ldap/ldapobject.py /usr/local/lib/python2.4/site-packages/ldap/ldapobject.pyc /usr/local/lib/python2.4/site-packages/ldap/ldapobject.pyo /usr/local/lib/python2.4/site-packages/ldap/modlist.py /usr/local/lib/python2.4/site-packages/ldap/modlist.pyc /usr/local/lib/python2.4/site-packages/ldap/modlist.pyo /usr/local/lib/python2.4/site-packages/ldap/sasl.py /usr/local/lib/python2.4/site-packages/ldap/sasl.pyc /usr/local/lib/python2.4/site-packages/ldap/sasl.pyo /usr/local/lib/python2.4/site-packages/ldap/schema/__init__.py /usr/local/lib/python2.4/site-packages/ldap/schema/__init__.pyc /usr/local/lib/python2.4/site-packages/ldap/schema/__init__.pyo /usr/local/lib/python2.4/site-packages/ldap/schema/models.py /usr/local/lib/python2.4/site-packages/ldap/schema/models.pyc /usr/local/lib/python2.4/site-packages/ldap/schema/models.pyo /usr/local/lib/python2.4/site-packages/ldap/schema/subentry.py /usr/local/lib/python2.4/site-packages/ldap/schema/subentry.pyc /usr/local/lib/python2.4/site-packages/ldap/schema/subentry.pyo /usr/local/lib/python2.4/site-packages/ldap/schema/tokenizer.py /usr/local/lib/python2.4/site-packages/ldap/schema/tokenizer.pyc /usr/local/lib/python2.4/site-packages/ldap/schema/tokenizer.pyo /usr/local/lib/python2.4/site-packages/ldapurl.py /usr/local/lib/python2.4/site-packages/ldapurl.pyc /usr/local/lib/python2.4/site-packages/ldapurl.pyo /usr/local/lib/python2.4/site-packages/ldif.py /usr/local/lib/python2.4/site-packages/ldif.pyc /usr/local/lib/python2.4/site-packages/ldif.pyo /usr/local/lib/python2.4/site-packages/_ldap.so __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From roland.hedberg at adm.umu.se Fri Sep 29 09:33:34 2006 From: roland.hedberg at adm.umu.se (Roland Hedberg) Date: Fri, 29 Sep 2006 09:33:34 +0200 Subject: Problem parsing LDIF change records Message-ID: <451CCC4E.4090700@adm.umu.se> Hi! I'm having problem with LDIFParser and LDIF change records. I'm using 2.2.0 which to my knowledge is the last official release. The problematic line is line 382 in LDIFParser.parse(), the last one of the following snippet. elif attr_type=='changetype': # attr type and value pair was DN of LDIF record if dn is None: raise ValueError, 'Read changetype: before getting valid dn: line.' if changetype!=None: raise ValueError, 'Two lines starting with changetype: in one record.' if not valid_changetype_dict.has_key(attr_value): raise ValueError, 'changetype value %s is invalid.' % (repr(attr_value)) dn = attr_value What happens here is that you replace the dn value, that you earlier has picked up from the LDIF record, with the change type. There is no easy way to figure out the dn later in the process and if you like me really, really need the dn then you're lost. So, to solve my problem, I've change the last line to: changetype = attr_value And then futher down the line self.handle(dn,entry,changetype) Which of course means I have to change the definition of handle to def handle(self,dn,entry,changetype=None): I get the impression from the code that this was the intention but then somehow the coder got sidestepped :-) -- Roland From roland.hedberg at adm.umu.se Fri Sep 29 10:33:11 2006 From: roland.hedberg at adm.umu.se (Roland Hedberg) Date: Fri, 29 Sep 2006 10:33:11 +0200 Subject: Problem parsing LDIF change records In-Reply-To: <451CCC4E.4090700@adm.umu.se> References: <451CCC4E.4090700@adm.umu.se> Message-ID: <451CDA47.7070205@adm.umu.se> Roland Hedberg wrote: > Hi! > > I'm having problem with LDIFParser and LDIF change records. > I'm using 2.2.0 which to my knowledge is the last official release. No offence, but has anybody ever used python-ldap to handle LDIF change records ? Working my way down into the code, it becomes more and more obvious that there is no way it would have worked as expected. -- Roland From steuwer at univention.de Fri Sep 29 10:46:19 2006 From: steuwer at univention.de (Ingo Steuwer) Date: Fri, 29 Sep 2006 10:46:19 +0200 Subject: Problem parsing LDIF change records In-Reply-To: <451CDA47.7070205@adm.umu.se> References: <451CCC4E.4090700@adm.umu.se> <451CDA47.7070205@adm.umu.se> Message-ID: <200609291046.25808.steuwer@univention.de> Am Freitag, 29. September 2006 10:33 schrieb Roland Hedberg: > Roland Hedberg wrote: > > Hi! > > > > I'm having problem with LDIFParser and LDIF change records. > > I'm using 2.2.0 which to my knowledge is the last official release. > > No offence, but has anybody ever used python-ldap to handle LDIF change > records ? > > Working my way down into the code, it becomes more and more obvious that > there is no way it would have worked as expected. AFAIK support for LDAP-modlists is not implemented, only import of LDAP-objects. Ingo Steuwer > -- Roland > > > > From michael at stroeder.com Fri Sep 29 11:43:10 2006 From: michael at stroeder.com (=?ISO-8859-1?Q?Michael_Str=F6der?=) Date: Fri, 29 Sep 2006 11:43:10 +0200 Subject: Problem parsing LDIF change records In-Reply-To: <451CDA47.7070205@adm.umu.se> References: <451CCC4E.4090700@adm.umu.se> <451CDA47.7070205@adm.umu.se> Message-ID: <451CEAAE.8020304@stroeder.com> Roland Hedberg wrote: > Roland Hedberg wrote: > >>I'm having problem with LDIFParser and LDIF change records. >>I'm using 2.2.0 which to my knowledge is the last official release. > > No offence, but has anybody ever used python-ldap to handle LDIF change > records ? No, change records are not supported yet. > Working my way down into the code, it becomes more and more obvious that > there is no way it would have worked as expected. Never had the spare time to finish it especially since I didn't have a clear plan on how to handle different LDAP operations. One idea was to implement separate methods like handle_op_add(), handle_op_modify(), handle_op_delete()... I'd appreciate if you could fix it. Patches welcome. If it turns out that it's necessary to change the class API completely it might be a good idea to implement a separate class (or even a separate module). See also SF#790789: http://sourceforge.net/tracker/index.php?func=detail&aid=790789&group_id=2072&atid=352072 Ciao, Michael. From roland.hedberg at adm.umu.se Fri Sep 29 15:02:47 2006 From: roland.hedberg at adm.umu.se (Roland Hedberg) Date: Fri, 29 Sep 2006 15:02:47 +0200 Subject: Problem parsing LDIF change records In-Reply-To: <451CEAAE.8020304@stroeder.com> References: <451CCC4E.4090700@adm.umu.se> <451CDA47.7070205@adm.umu.se> <451CEAAE.8020304@stroeder.com> Message-ID: <451D1977.1010901@adm.umu.se> Michael Str?der wrote: > Roland Hedberg wrote: >> Roland Hedberg wrote: >> >>> I'm having problem with LDIFParser and LDIF change records. >>> I'm using 2.2.0 which to my knowledge is the last official release. >> No offence, but has anybody ever used python-ldap to handle LDIF change >> records ? > > No, change records are not supported yet. > >> Working my way down into the code, it becomes more and more obvious that >> there is no way it would have worked as expected. > > Never had the spare time to finish it especially since I didn't have a > clear plan on how to handle different LDAP operations. One idea was to > implement separate methods like handle_op_add(), handle_op_modify(), > handle_op_delete()... > > I'd appreciate if you could fix it. Patches welcome. If it turns out > that it's necessary to change the class API completely it might be a > good idea to implement a separate class (or even a separate module). Well, since I need it, I'll have to fix it ! When I have something I'll submit it for review. > See also SF#790789: > http://sourceforge.net/tracker/index.php?func=detail&aid=790789&group_id=2072&atid=352072 Goodness gracious, this is exactly the path I've chosen so far. And without even knowing about this ticket. -- Roland From delphij at delphij.net Sat Sep 30 09:54:39 2006 From: delphij at delphij.net (LI Xin) Date: Sat, 30 Sep 2006 15:54:39 +0800 Subject: Can't Import LDAP In-Reply-To: <20060928145932.14971.qmail@web58413.mail.re3.yahoo.com> References: <20060928145932.14971.qmail@web58413.mail.re3.yahoo.com> Message-ID: <451E22BF.3030205@delphij.net> Ted Johnson wrote: > 2 > > */LI Xin /* wrote: > > Hi, Ted, > > Ted Johnson wrote: > > Hi; > > I'm on FreeBSD 6.1. I've successfully installed OpenLDAP from the port > > (I can issue commands to the s/w at the prompt) and it appears > I've done > > the same with py-ldap2 (don't know what commands to issue, but FreeBSD > > says the s/w was loaded successfully). However, when I fire up my > Python > > interpreter and enter "import ldap" I'm told no such module exists. > > What could I be doing wrong? > > I do use py-ldap2 on FreeBSD a lot, and I think I have did a good job on > the port ;-) so I would like to help out. > > Which python release do you use? > > 2.3.5 > > Will you please check the output of > 'pkg_info -L py24-ldap2-2.2.0' to confirm that it has installed the > stuff into your python installation's site-packages/ directory? > > Here it is, thanks for your help, and TIA for any further direction > you can provide. > Ted > > server167# pkg_info -L py24-ldap2-2.2.0 > Information for py24-ldap2-2.2.0: > > Files: > /usr/local/lib/python2.4/site-packages/dsml.py > /usr/local/lib/python2.4/site-packages/dsml.pyc It seems that you have side-by-side installation of Python 2.4 and 2.3. Will you please deinstall one and re-install python-ldap, to see if it is built with python-2.3? BTW. If you do not have specific reason to use Python 2.3.x (be sure to rebuild all py23-*), I would suggest that you install 2.4 series. Cheers, -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature URL: