You can subscribe to this list here.
2000 |
Jan
|
Feb
(34) |
Mar
(9) |
Apr
|
May
(2) |
Jun
(14) |
Jul
(67) |
Aug
(34) |
Sep
(5) |
Oct
(20) |
Nov
(22) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(15) |
Feb
(16) |
Mar
(20) |
Apr
(13) |
May
(72) |
Jun
(42) |
Jul
(41) |
Aug
(11) |
Sep
(19) |
Oct
(67) |
Nov
(59) |
Dec
(57) |
2002 |
Jan
(74) |
Feb
(69) |
Mar
(34) |
Apr
(55) |
May
(47) |
Jun
(74) |
Jul
(116) |
Aug
(68) |
Sep
(25) |
Oct
(42) |
Nov
(28) |
Dec
(52) |
2003 |
Jan
(19) |
Feb
(18) |
Mar
(35) |
Apr
(49) |
May
(73) |
Jun
(39) |
Jul
(26) |
Aug
(59) |
Sep
(33) |
Oct
(56) |
Nov
(69) |
Dec
(137) |
2004 |
Jan
(276) |
Feb
(15) |
Mar
(18) |
Apr
(27) |
May
(25) |
Jun
(7) |
Jul
(13) |
Aug
(2) |
Sep
(2) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
2005 |
Jan
(22) |
Feb
(25) |
Mar
(41) |
Apr
(17) |
May
(36) |
Jun
(13) |
Jul
(22) |
Aug
(12) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
|
2006 |
Jan
(11) |
Feb
(3) |
Mar
(5) |
Apr
(22) |
May
(1) |
Jun
(10) |
Jul
(19) |
Aug
(7) |
Sep
(25) |
Oct
(23) |
Nov
(5) |
Dec
(27) |
2007 |
Jan
(25) |
Feb
(17) |
Mar
(44) |
Apr
(8) |
May
(33) |
Jun
(31) |
Jul
(42) |
Aug
(16) |
Sep
(12) |
Oct
(16) |
Nov
(23) |
Dec
(73) |
2008 |
Jan
(26) |
Feb
(6) |
Mar
(46) |
Apr
(17) |
May
(1) |
Jun
(44) |
Jul
(9) |
Aug
(34) |
Sep
(20) |
Oct
(2) |
Nov
(4) |
Dec
(16) |
2009 |
Jan
(14) |
Feb
(3) |
Mar
(45) |
Apr
(52) |
May
(34) |
Jun
(32) |
Jul
(24) |
Aug
(52) |
Sep
(22) |
Oct
(23) |
Nov
(19) |
Dec
(10) |
2010 |
Jan
(10) |
Feb
(13) |
Mar
(22) |
Apr
(9) |
May
(1) |
Jun
(1) |
Jul
(8) |
Aug
(9) |
Sep
(10) |
Oct
(1) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
|
Feb
(18) |
Mar
(39) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rakotomandimby M. <mih...@et...> - 2006-01-03 17:40:55
|
Hi, I saw that many tutorials introducing python-ldap are about lookup and editing entries. There is a few documents about addin entries. I concluded the "way to do it" is about adding a simple entry, and then edit it... Would you have any other documentation about adding entry? I am more french speaking and would rather begin with introductional tutorial first, then go on with official documentation. Thank you. -- A powerfull GroupWare, CMS, CRM, ECM: CPS (Open Source & GPL). Opengroupware, SPIP, Plone, PhpBB, JetSpeed... are good: CPS is better. http://www.cps-project.org for downloads & documentation. Free hosting of CPS groupware: http://www.objectis.org. |
From: alessandro o. <ale...@un...> - 2005-11-23 20:33:42
|
I recently switched to latest version from 2.0.4 and i found a major change in result()'s behaviour: [snip] $ python Python 2.3.5 (#2, Nov 20 2005, 16:40:39) [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ldap >>> l = ldap.initialize('ldap://minotest.si.unimib.it') >>> l.simple_bind('cn=admin,dc=taz', 'canegiallo') 1 >>> l.result(1,1,0) (97, []) >>> l.result(1,1,0) Traceback (most recent call last): File "<stdin>", line 1, in ? File "ldap/ldapobject.py", line 405, in result res_type,res_data,res_msgid = self.result2(msgid,all,timeout) File "ldap/ldapobject.py", line 409, in result2 res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout) File "ldap/ldapobject.py", line 415, in result3 rtype, rdata, rmsgid, serverctrls = self._ldap_call(self._l.result3,msgid,all,timeout) ValueError: unpack tuple of wrong size [/snip] btw, i'm glad to do some debug on my apps, that apparently polls to much <g>, but i think it's broken. At line 415, i see: rtype, rdata, rmsgid, serverctrls = self._ldap_call(self._l.result3,msgid,all,timeout) but in LDAPObject.c : if (res_type == 0) { /* Polls return (None, None, None); timeouts raise an exception */ if (timeout == 0) return Py_BuildValue("(OOO)", Py_None, Py_None, Py_None); else return LDAPerr(LDAP_TIMEOUT); } that doesn't match python code. So is maybe sufficient to patch this file the way i attached (but i'll write maybe some more extensive test, python-ldap is critical for a lot of our applications). TIA, -- Alessandro Ogier <ale...@un...> gpg --keyserver pgp.mit.edu --recv-keys EEBB4D0D Universita` degli Studi di Milano - Bicocca Sistemi Informativi Via Cozzi 53 - I 20125 Milano Italy Tel. +39 02 6448 5526 |
From: Mark R. <ma...@bo...> - 2005-11-07 15:37:02
|
Here's a snap: running build_py file Lib/ldap.py (for module ldap) not found file Lib/ldap/schema.py (for module ldap.schema) not found I'm not subscribed to the list, so please CC me in case of any replies :) -- .-. Mark Rosenstand (-.) oo| cc ) /`'\ (+45) 255 31337 3-n-( (\_;/) ma...@bo... _(|/`-> |
From: <mi...@st...> - 2005-11-07 12:06:05
|
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema). ---------------------------------------------------------------- Released 2.0.11 2005-11-07 Changes since 2.0.10: Lib/ * Class ldap.ldapobject.LDAPObject: Each method returns a result now * Class ldap.ldapobject.ReconnectLDAPObject: Some methods called the wrong methods of LDAPObject. Fixed. * Added new class ldap.async.Dict * Slightly cleaned up ldap.schema.subentry.attribute_types() * New sub-module ldap.resiter which simply provides a mix-in class for ldap.ldapobject.LDAPObject with a generator method allresults(). Obviously this only works with Python 2.3+. And it's still experimental. |
From: <mi...@st...> - 2005-11-03 12:33:48
|
HI! Note that I've checked in a modified version of Lib/ldap/ldapobject.py. It contains some major fixes for how methods are called and results are returned. I'd like to encourage everybody to test it with own applications! Ciao, Michael. |
From: Matthew S. <mp...@ut...> - 2005-10-25 05:13:28
|
Hello! I am trying to get python-ldap 2.0.10 to work with Mac OS X 10.4 (tiger) Server. I am getting the error posted below, and after poking about on the list archives for a time, I saw a post with a similar problem (http://sourceforge.net/mailarchive/message.php?msg_id=12199305). The solution suggested was to recompile openldap, as the Apple supplied one is limited. This worked for me, and now python ldap is working fine (after a few quick changes to the setup.cfg), though I'd prefer to use Apple's ldap implementation if I could. Has anyone got python-ldap to work with 10.4 server using only Apple's openldap and python? Thanks for any help. Cheers, Matthew Smith Python 2.4.2 (#1, Oct 24 2005, 17:07:11) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ldap Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/share/python/lib/python2.4/site-packages/ldap/__init__.py", line 21, in ? from _ldap import * ImportError: Failure linking new module: /usr/share/python/lib/python2.4/site-packages/_ldap.so: Symbol not found: _ldap_str2attributetype Referenced from: /usr/share/python/lib/python2.4/site-packages/_ldap.so Expected in: dynamic lookup |
From: Michele M. <mic...@ma...> - 2005-10-12 16:54:18
|
> Instrument the code in the LDAPUserFolder so it writes out queries to > a file, for example. You just want to find out what the last queries > are before things go wrong. The goal is to take the LDAPUserFolder out > of the equation and provoke this behavior with just python-ldap. Ok... hemm... What sould I do exactly? ;-)) I'm sorry but I've no Idea... I'm just a python beginner. Thanks, Michele -- mic...@ma... / phone: +41 44 632 6193 eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich !DSPAM:434d3fb2246012105311696! |
From: Jens V. <je...@da...> - 2005-10-12 16:46:48
|
On 12 Oct 2005, at 17:42, Michele Marcionelli wrote: >>> Can someone help me? >>> >> >> Not without doing what I asked you to do: Find out what invocation >> and query caused the problem. Reduce it to a simple test case that >> provokes the problem. >> > > I don't know if there is a specific query that causes the problem. > > - I start zope: everything work fine > - Nobody access the Server > - Wait... let say... one hour > - and I can't login as ldap-user anymore... > - in the logfile appears the "NULL result without error in > PyObject_Call" message > > Is that maybe a timeout/connection problem? You improved something > like that in the 2.3 or 2.4 Version of LDAPUserFolder. No, this is not a timeout problem. If it was, then the exception returned by the server would tell you so. Instrument the code in the LDAPUserFolder so it writes out queries to a file, for example. You just want to find out what the last queries are before things go wrong. The goal is to take the LDAPUserFolder out of the equation and provoke this behavior with just python-ldap. jens |
From: Michele M. <mic...@ma...> - 2005-10-12 16:42:50
|
Hi Jens, On 12.10.2005, at 18:24, Jens Vagelpohl wrote: > On 12 Oct 2005, at 17:18, Michele Marcionelli wrote: >>> From: Jens Vagelpohl >>> I'm still not sure if I will be able to help you because that's in >>> the C layer which I never looked at. It would be helpful, even if >>> it's done just for the purpose of tossing this onto the python-ldap >>> list, for you to find out the specific query and invocation that >>> causes this. >> >> Can someone help me? > > Not without doing what I asked you to do: Find out what invocation and > query caused the problem. Reduce it to a simple test case that > provokes the problem. I don't know if there is a specific query that causes the problem. - I start zope: everything work fine - Nobody access the Server - Wait... let say... one hour - and I can't login as ldap-user anymore... - in the logfile appears the "NULL result without error in PyObject_Call" message Is that maybe a timeout/connection problem? You improved something like that in the 2.3 or 2.4 Version of LDAPUserFolder. HTH, Michele -- mic...@ma... / phone: +41 44 632 6193 eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich !DSPAM:434d3cfe211325585820369! |
From: Jens V. <je...@da...> - 2005-10-12 16:24:46
|
On 12 Oct 2005, at 17:18, Michele Marcionelli wrote: >> From: Jens Vagelpohl >> I'm still not sure if I will be able to help you because that's in >> the C layer which I never looked at. It would be helpful, even if >> it's done just for the purpose of tossing this onto the python-ldap >> list, for you to find out the specific query and invocation that >> causes this. >> > > Can someone help me? Not without doing what I asked you to do: Find out what invocation and query caused the problem. Reduce it to a simple test case that provokes the problem. jens |
From: Michele M. <mic...@ma...> - 2005-10-12 16:18:50
|
Hello, I have a problem with the LDAPUserFolder and the developer suggested me to post the problem here: System: Red Hat Enterprise Linux AS release 4 (Nahant Update 2) gcc version 3.4.3 Python 2.3.5 Zope 2.7.7 LDAPUserFolder 2.2 and >=2.5 OpenLDAP 2.2.13 python-ldap 2.0.10 Description: With the 2.2 Version of LDAPUserFolder I haven't any problem but with the others mentioned I get after a while (could be 5 minutes or 1 hour) the following error messages: (4) May 24 21:50:13: getUserByAttr: "uid=mmarcio" not found (4) May 24 21:50:13: _lookupuserbyattr: No user "uid=mmarcio" (NULL result without error in PyObject_Call) (9) May 24 21:50:13: _lookupuserbyattr: Using filter "(&(uid=mmarcio)(objectClass=top)(objectClass=person))" (9) May 24 21:50:13: _lookupuserbyattr: Binding as "cn=nethz_proxy,ou=admins,ou=id,ou=auth,o=ethz,c=ch" (3) May 24 21:49:39: LDAPUserFolder reinitialized by __setstate__ (4) May 24 17:29:05: getUserByAttr: "uid=admin" not found (4) May 24 17:29:05: _lookupuserbyattr: Binding as "cn=admin,ou=users,ou=nethz,ou=id,ou=auth,o=ethz,c=ch" fails (9) May 24 17:29:05: _lookupuserbyattr: Using filter "(&(uid=admin)(objectClass=top)(objectClass=person))" (9) May 24 17:29:05: _lookupuserbyattr: Binding as "cn=nethz_proxy,ou=admins,ou=id,ou=auth,o=ethz,c=ch" I can "solve" the problem only if I restart my Zope Instance. The developer replied to me: >>> From: Jens Vagelpohl >>> This error message originates in the python-ldap extensions >>> themselves. There is no C code in the LDAPUserFolder product. If you >>> made any changes to python-ldap when you upgraded the LDAPUserFolder >>> package I suggest trying different versions of python-ldap. I'm >>> afraid there isn't much I can do to help. >> >> From: Michele Marcionelli >> But what I didn't understand is, that I use 2 different LDAP User >> Folders (2.2 and 2.5) with the same Python/Zope, i.e. with the same >> python-ldap. >> >> How can I give you more information? Debug? Etc.? > > From: Jens Vagelpohl > I'm still not sure if I will be able to help you because that's in > the C layer which I never looked at. It would be helpful, even if > it's done just for the purpose of tossing this onto the python-ldap > list, for you to find out the specific query and invocation that > causes this. Can someone help me? Cheers, Michele -- mic...@ma... / phone: +41 44 632 6193 eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich !DSPAM:434d375a115958476112754! |
From: Oleg P. <o....@dp...> - 2005-09-29 16:47:19
|
Thu, Sep 29, 2005 at 02:55:07PM +0200, pyt...@li...urce= forge.net =CE=C1=D0=C9=D3=C1=CC: > I want to move user Tester from TestGroup1 to TestGroup2 in Active=20 > Directory with py-24-ldap2-2.0.7, python-2.4.1. > I can not guess how I can do this. > With modify_s? I tryed following variant, sorry for a huge code posting: import ldap,sys,re class ADS_if: ..... def open_connection(self): try: ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_= NEVER) ldap.set_option(ldap.OPT_REFERRALS, 0) self.ldap_h =3D ldap.initialize("ldaps://%s"%self.server) self.ldap_h.simple_bind_s(self.user, self.password) except ldap.LDAPError, error_message: print >> sys.stderr, "Couldn't Connect to %s@%s. %s " % (err= or_message, self.user, self.server) sys.exit(1) def getDN(self, user, enc=3D'koi8-r'): self.open_connection() user =3D unicode(user, enc) filter =3D "sAMAccountName=3D%s"%user.encode('utf-8') count =3D 0 result_set =3D [] result_id =3D self.ldap_h.search(self.base, self.scope, filter,= self.retrieve_attributes) i =3D 0 result_type, result_data =3D self.ldap_h.result(result_id, self= .timeout) if result_type =3D=3D ldap.RES_SEARCH_ENTRY: result_set.append(result_data) if len(result_set)=3D=3D0: print 'No such user: %s'%user return [] else: return unicode(result_set[0][0][0],'utf-8') =20 def delUserFromGroup(self, user, group, enc=3D'koi8-u'): userDN=3Dself.getDN(user, enc) groupDN=3Dself.getDN(group, enc) print 'dn=3D"%s"'%userDN.encode(enc) print 'group=3D"%s"'%groupDN.encode(enc) self.ldap_h.modify_s(userDN.encode('utf-8'), [(ldap.MOD_DELETE,= 'memberOf',groupDN.encode('utf-8'))]) =20 >>> from ADS import ADS_if >>> lh =3D ADS_if() >>> lh.delUserFromGroup('spd.student','For_install') dn=3D"CN=3D=F3=D4=D5=C4=C5=CE=D4 =F3=F0=E4,OU=3D=B6=F3=E3=ED=F0=E4,OU=3D=B6= =F3=E3,DC=3Ddp,DC=3Duz,DC=3Dgov,DC=3Dua" group=3D"CN=3DFor_install,CN=3DUsers,DC=3Ddp,DC=3Duz,DC=3Dgov,DC=3Dua" Traceback (most recent call last): File "<stdin>", line 1, in ? File "ADS.py", line 136, in delUserFromGroup self.ldap_h.modify_s(userDN.encode('utf-8'), [(ldap.MOD_DELETE,'membe= rOf',groupDN.encode('utf-8'))]) ............. ldap.UNWILLING_TO_PERFORM: {'info': '0000209A: SvcErr: DSID-031A0983, pro= blem 5003 (WILL_NOT_PERFORM), data 0\n', 'desc': 'Server is unwilling to = perform'} am I in a right way :) ? and how can I fix my program to avoid this error? Thanks for any help. --=20 Best regards, Palij Oleg, ISC (Pridn railway)=20 xmpp://ma...@ja... |
From: Oleg P. <o....@dp...> - 2005-09-29 11:51:10
|
I want to move user Tester from TestGroup1 to TestGroup2 in Active Directory with py-24-ldap2-2.0.7, python-2.4.1. I can not guess how I can do this. With modify_s? Is it possible in principle? P.S. Searching works ok. Thanks for help. -- Best regards, Palij Oleg, ISC (Pridn railway) xmpp://ma...@ja... |
From: Oleg P. <o....@dp...> - 2005-09-29 11:18:41
|
Hi, all! I want to move user Tester from TestGroup1 to TestGroup2 in Active Directory with py-24-ldap2-2.0.7, python-2.4.1. I can not guess how I can do this. With modify_s? Is it possible in principle? P.S. Searching works ok. Please, if it possible, cc: to o.palij(at)dp.uz.gov.ua, becouse I could not subscribe this list. Thanks for help. -- Best regards, Palij Oleg, ISC (Pridn railway) xmpp://ma...@ja... |
From: Mauro C. <mci...@li...> - 2005-09-26 21:31:11
|
Erik Forsberg ha scritto: >[...] rpm package version python-ldap-2.0.0pre19-75.1. > > This is _very_ old. I think you should consider to upgrade it, if it's at all possible. It might also be the source of your problem, see below. Current version is 2.0.10, which is a long way from 2.0.0pre19. >In that package, ldap.RES_SEARCH_RESULT was 'RES_SEARCH_RESULT' and >code was 101. > > The use of strings as return codes in lieu of numbers used to be the norm in old implementations, as you might know. I thought it was abandoned with the 2.x line, but maybe it lingered in some old versions. Or maybe a regression mistake? >Has there been an API change that I've missed? > Not that I know of. >Is the SuSE package terribly wrong? > Maybe :-) HTH, Mauro |
From: Erik F. <for...@ce...> - 2005-09-26 14:41:43
|
Hi! My world just turned upside down. I've been using asynchronous python-ldap with code that looks something like this, for a long time: import ldap ldapconn = ldap.initialize(uri) searchsid = ldapconn.search(base, scope, filter, attrlist) while 1: (code, data) = ldapconn.result(msgid=searchsid, all=0) if ldap.RES_SEARCH_RESULT == code: break This has worked very well. Until today, on a Novell Linux Desktop 9, with a python-ldap package borrowed from SLES9, with rpm package version python-ldap-2.0.0pre19-75.1. In that package, ldap.RES_SEARCH_RESULT was 'RES_SEARCH_RESULT' and code was 101. In all other python-ldap packages I've seen, the ldap.RES_SEARCH_RESULT has always been a number (101). The code returned from ldapconn.result has also always been a number. Both are numbers in my Debian-packaged python2.3-ldap 2.0.4-1. Am I confused? Has there been an API change that I've missed? Is the SuSE package terribly wrong? (could be a problem caused by the running of a SLES9 package on top of NLD9, but still very odd) Regards, \EF -- Erik Forsberg OpenSource-based Thin Client Technology Cendio AB Phone: +46-13-21 46 00 Web: http://www.thinlinc.com |
From: <mi...@st...> - 2005-09-23 10:42:35
|
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema). ---------------------------------------------------------------- Released 2.0.10 2005-09-23 Changes since 2.0.9: Lib/ * Switched back to old implementation of ldap.schema.tokenizer.split_tokens() since the new one had a bug which deletes the spaces from DESC * ldap.INSUFFICIENT_ACCESS is now ignored in ldap.ldapobject.LDAPObject.search_subschemasubentry_s() |
From: <mi...@st...> - 2005-09-20 12:12:46
|
Wido, Michael Str=F6der wrote: > Wido Depping wrote: >=20 >> Attached are the updated testcase file and my improved split_tokens() >> function. >=20 > Your patches were added to CVS. This new implementation of split_tokens() deletes the spaces from DESC schema attributes. I looked at the code and the main problem is right at the beginning of the function: tokenList =3D s.split(" ") From my understanding there's no solution to save the spaces in DESC when using this code. I think there could be a better solution based on using keywordDict to find the relevant sections in the string. Still there would be some issues detecting whether the keyword appears inside colons. Ciao, Michael. |
From: <mi...@st...> - 2005-09-20 06:57:57
|
Wido, Michael Str=F6der wrote: > Wido Depping wrote: >=20 >> Attached are the updated testcase file and my improved split_tokens() >> function. >=20 > Your patches were added to CVS. This new implementation of split_tokens() deletes the spaces from DESC schema attributes. I looked at the code and the main problem is right at the beginning of the function: tokenList =3D s.split(" ") >From my understanding there's no solution to save the spaces in DESC when using this code. I think there could be a better solution based on using keywordDict to find the relevant sections in the string. Still there would be some issues detecting whether the keyword appears inside colons. Ciao, Michael. |
From: Wido D. <wid...@gm...> - 2005-09-20 05:03:32
|
On 9/19/05, Mark Roach <mr...@ok...> wrote: > On Thu, Sep 15, 2005 at 04:41:45PM +0200, Wido Depping wrote: > > Hi All, > > I've run accross a strange behaviour with simple_bind(). Instead of > > throwing exceptions when a bind wasn't succesful, it returns an > > integer. 4 for failure and 5 for success. Unfortunately I was assuming > > that this function would raise an exception. simple_bind_s() however > > behaves 'correctly'. Is this behaviour correct or a bug? >=20 > simple_bind is asynchronous, meaning that you need to take the number it > returns and pass it to result(). That's when it will raise the exception > The reason it works with the _s version of the function is that all the > _s functions are synchronous, i.e. they are the same as calling > c.result(c.function(params...)). Depending on the way your app is > architected, either one may be apropriate. Argh, shame on me. Somehow this was too obvious. I was distracted because of the unbind()/unbind_s() functions, where it's stated in the docs, that they are both synchronous ^^ mfg. Wido --=20 Wido Depping ICQ: 51303067 AIM: wido3379 Jabber: wi...@ja... |
From: Mark R. <mr...@ok...> - 2005-09-20 02:36:09
|
On Thu, Sep 15, 2005 at 04:41:45PM +0200, Wido Depping wrote: > Hi All, > I've run accross a strange behaviour with simple_bind(). Instead of > throwing exceptions when a bind wasn't succesful, it returns an > integer. 4 for failure and 5 for success. Unfortunately I was assuming > that this function would raise an exception. simple_bind_s() however > behaves 'correctly'. Is this behaviour correct or a bug? simple_bind is asynchronous, meaning that you need to take the number it returns and pass it to result(). That's when it will raise the exception >>> c.simple_bind('dc=okmaybe,dc=com', 'asdgfasfdg') 1 >>> c.result(1) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 399, in result res_type,res_data,res_msgid = self.result2(msgid,all,timeout) File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 405, in result2 return self._ldap_call(self._l.result2,msgid,all,timeout) File "/usr/lib/python2.4/site-packages/ldap/ldapobject.py", line 94, in _ldap_call result = func(*args,**kwargs) ldap.INVALID_CREDENTIALS: {'info': '', 'desc': 'Invalid credentials'} The reason it works with the _s version of the function is that all the _s functions are synchronous, i.e. they are the same as calling c.result(c.function(params...)). Depending on the way your app is architected, either one may be apropriate. -Mark |
From: Bjorn O. G. <bjo...@it...> - 2005-09-17 20:32:07
|
Heiko Noordhof: > > Hi, > > Is it possible with python-ldap to request de directory-context(s)a > certain ldap-server provides? What I mean is: say my openldap server > serves 2 databases: > dc=example,dc=com > dc=heiks,dc=nl > > Then, when my app (using python-ldap) connects to the server, is it > possible to retrieve these DN's? If so, how? If not, wouldn't it be a > nice feature? The equivalent search using ldapsearch (commandline utility) is ldapsearch -x -b "" -s base "objectClass=*" namingContexts Explanation: empty base, base-search (i.e. not one-level or subtree search).. then search for basically any object and retrieve only attribute namingContexts. The above searchfilter and attribute retrieval is only valid for OpenLDAP. Other LDAP-implementations differ slightly. We use this feature in Luma(.sourceforge.net) for automatic fetching the suffixes a given server handles. -- regards Bjorn Ove Grotan |
From: Wido D. <wid...@gm...> - 2005-09-15 14:41:54
|
Hi All, I've run accross a strange behaviour with simple_bind(). Instead of throwing exceptions when a bind wasn't succesful, it returns an integer. 4 for failure and 5 for success. Unfortunately I was assuming that this function would raise an exception. simple_bind_s() however behaves 'correctly'. Is this behaviour correct or a bug? mfg. Wido --=20 Wido Depping ICQ: 51303067 AIM: wido3379 Jabber: wi...@ja... |
From: Heiko N. <he...@xs...> - 2005-09-12 22:22:50
|
Hi, Is it possible with python-ldap to request de directory-context(s)a certain ldap-server provides? What I mean is: say my openldap server serves 2 databases: dc=example,dc=com dc=heiks,dc=nl Then, when my app (using python-ldap) connects to the server, is it possible to retrieve these DN's? If so, how? If not, wouldn't it be a nice feature? Thanks in advance, Heiko |
From: Heiko N. <hei...@xs...> - 2005-09-12 22:07:26
|
Hi, Is it possible with python-ldap to request de directory-context(s)a certain ldap-server provides? What I mean is: say my openldap server serves 2 databases: dc=example,dc=com dc=heiks,dc=nl Then, when my app (using python-ldap) connects to the server, is it possible to retrieve these DN's? If so, how? If not, wouldn't it be a nice feature? Thanks in advance, Heiko |