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: <mi...@st...> - 2003-12-22 09:25:57
|
Markus W. Weissmann wrote: > > I just wanted to let you know that we've got python-ldap in darwinports > [ http://darwinports.opendarwin.org/ ], > the (ng) ports collection for os-x/darwin; perhaps you want to add this > to the python-ldap homepage to the > downloads section. > You'll find it on our page here: > http://darwinports.opendarwin.org/ports?by=name&substr=py-ldap > (although this will take some hours for it to appears there, till the > index is updated) Added link to http://python-ldap.sourceforge.net/download.shtml Thanks for letting us know. Please watch out for announcements of new versions on pyt...@li... if not already subscribed to this list. Ciao, Michael. |
From: Jens V. <je...@zo...> - 2003-12-21 15:31:08
|
> Please update your local CVS directory and test! Building and some simple bind/search tests against the built-in OpenLDAP on Mac OS X 10.3.1 work fine. jens |
From: <mi...@st...> - 2003-12-21 14:58:48
|
HI! I tried to substitute most of the functions which are marked as deprecated in ldap.h of current OpenLDAP C API. Please update your local CVS directory and test! Note that there are all the arguments ready to pass around server and client controls to the OpenLDAP C API but it's not implemented yet. Any takers? Still left is usage of deprecated function ldap_bind(). According to K. Zeilenga ldap_sasl_bind() should be used instead even for simple bind. I'm not clear about the state of the SASL-related code. Please also take note of file TODO and please contribute if you are able to spend some time. Ciao, Michael. |
From: <mi...@st...> - 2003-12-10 09:37:38
|
Christian Klinger wrote: > Michael Str=C3=B6der wrote: >=20 >>Probably the LDAP servers limits the time span your LDAP connection is >>valid and drops the connection. You have to deal with that in your >>application. >=20 > I'm using OpenLdap=20 > Do you know the name of the parameter which i must configure! > I see nothing in the OpenLdap -log file! Well, man slapd.conf reveals that parameters 'idletimeout' and 'limits'=20 looks promising. This is off-topic here. ope...@op... i= s=20 the forum to ask details about this. >>ldap.ldapobject.ReconnectLDAPObject is probably what you're looking fo= r. >>Note that I screwed up a module import in ReconnectLDAPObject in curre= nt >>2.0.0pre17. Use upcoming 2.0.0pre18 instead. Anyway ldap.ldapobject.ReconnectLDAPObject is the proper way to deal with= =20 it. I released 2.0.0pre18 yesterday. Ciao, Michael. |
From: Christian K. <chr...@ec...> - 2003-12-10 08:00:02
|
On Tuesday 09 December 2003 20:43, you wrote: > Klinger Christian wrote: > > The Problem: > > I make some LDAP Queries (Zope External Method) over a large network! > > Sometimes i got a "good" result but sometimes i got the error > > "Can=C2=B4t contact LDAP-Server"! > > Probably the LDAP servers limits the time span your LDAP connection is > valid and drops the connection. You have to deal with that in your > application. > > ldap.ldapobject.ReconnectLDAPObject is probably what you're looking for= =2E > Note that I screwed up a module import in ReconnectLDAPObject in curren= t > 2.0.0pre17. Use upcoming 2.0.0pre18 instead. > > Ciao, Michael. I'm using OpenLdap=20 Do you know the name of the parameter which i must configure! I see nothing in the OpenLdap -log file! thx christian |
From: <mi...@st...> - 2003-12-09 20:23:28
|
Find a new pre-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.0pre18 2003-12-09 Changes since 2.0.0pre17: ldap.ldapobject: * Fixed missing ldap._ldap_function_call() in ReconnectLDAPObject.reconnect() ---------------------------------------------------------------- Released 2.0.0pre17 2003-12-03 Changes since 2.0.0pre16: ldap.functions: * Fixed ImportError when running python -O |
From: <mi...@st...> - 2003-12-09 19:44:00
|
Klinger Christian wrote: >=20 > The Problem: > I make some LDAP Queries (Zope External Method) over a large network! > Sometimes i got a "good" result but sometimes i got the error=20 > "Can=B4t contact LDAP-Server"! Probably the LDAP servers limits the time span your LDAP connection is valid and drops the connection. You have to deal with that in your applic= ation. ldap.ldapobject.ReconnectLDAPObject is probably what you're looking for. Note that I screwed up a module import in ReconnectLDAPObject in current 2.0.0pre17. Use upcoming 2.0.0pre18 instead. Ciao, Michael. |
From: Jens V. <je...@zo...> - 2003-12-09 12:45:52
|
I suggest you move the code that connects to the server into the method. jens On Dec 9, 2003, at 5:41, Klinger Christian wrote: > Hello List > > The Problem: > I make some LDAP Queries (Zope External Method) over a large network! > Sometimes i got a "good" result but sometimes i got the error > "Can=B4t contact LDAP-Server"! > > Is it possible to get over on a "timeout limit"? > Is it possible to trace something? > > > Do you have any tips for me? > > Thx in advance > > Christian > > The "short code of the programm > > --snip-- > import ldap > > server =3D '10.99.29.9' > admin =3D "cn=3Dldapadmin,o=3Dcnbg,c=3Dde" > passw =3D "xxxxxxxx" > > > l=3Dldap.open(server) > l.protocol_version =3D ldap.VERSION3 > l.simple_bind_s(admin,passw) > > def e_ldapsearch(name,flag): > basedn =3D "o=3Dcnbg,c=3Dde" > sfilter =3D "(&(objectclass=3DdrupaPerson)(cn=3D%s))" %name > res =3D l.search_s(basedn, ldap.SCOPE_SUBTREE, sfilter) # line = 72 > return res > --snip-- > > The Traceback from Zope: > __call__<BR>__traceback_info__: ((), {'flag': 'bgdpextranet', = 'name': > 9909040001}, None) > Module /opt/Zope/Extensions/e_ldapsearch.py, line 72, in ldapsearch > Module ldap.ldapobject, line 421, in search_s > Module ldap.ldapobject, line 425, in search_st > Module ldap.ldapobject, line 371, in result > Module ldap.ldapobject, line 94, in _ldap_call = </LI></UL>SERVER_DOWN: > {'desc': "Can't contact LDAP server", 'info': ''} |
From: Klinger C. <ckl...@ec...> - 2003-12-09 11:41:32
|
Hello List The Problem: I make some LDAP Queries (Zope External Method) over a large network! Sometimes i got a "good" result but sometimes i got the error=20 "Can=B4t contact LDAP-Server"! Is it possible to get over on a "timeout limit"=3F Is it possible to trace something=3F Do you have any tips for me=3F Thx in advance Christian The "short code of the programm --snip-- import ldap server =3D '10.99.29.9' admin =3D "cn=3Dldapadmin,o=3Dcnbg,c=3Dde" passw =3D "xxxxxxxx" l=3Dldap.open(server) l.protocol=5Fversion =3D ldap.VERSION3 l.simple=5Fbind=5Fs(admin,passw) def e=5Fldapsearch(name,flag): basedn =3D "o=3Dcnbg,c=3Dde" sfilter =3D "(&(objectclass=3DdrupaPerson)(cn=3D%s))" %name res =3D l.search=5Fs(basedn, ldap.SCOPE=5FSUBTREE, sfilter) # line 72 return res --snip-- The Traceback from Zope: =5F=5Fcall=5F=5F<BR>=5F=5Ftraceback=5Finfo=5F=5F: ((), {'flag': 'bgdpextr= anet', 'name':=20 9909040001}, None)=20 Module /opt/Zope/Extensions/e=5Fldapsearch.py, line 72, in ldapsearch=20 Module ldap.ldapobject, line 421, in search=5Fs=20 Module ldap.ldapobject, line 425, in search=5Fst=20 Module ldap.ldapobject, line 371, in result=20 Module ldap.ldapobject, line 94, in =5Fldap=5Fcall </LI></UL>SERVER=5FDOW= N:=20 {'desc': "Can't contact LDAP server", 'info': ''}=20 |
From: <mi...@st...> - 2003-12-05 12:13:32
|
Lukas Meyer wrote: > > I want to show the whole tree with a for loop or anything else. Really the whole tree at once? Then you could retrieve the whole sub-tree in one search request and sort the reversed normalized DN into a list or to construct a dictionary-based tree-structure depending on your needs. I'm doing this to reconstruct the correct tree order of entries in LDIF files. Off course this does not scale well on directories with 100000+ entries since it consumes memory. Also be prepared to hit a search limit which will leave your tree incomplete. > hasLeaveEntry() is a funktion that returns 0 or 1 if a subentry is there. > > for name, attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, > "objectclass=*", []): > x = hasLeaveEntry(name) > if x == 1: > for name, attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, > "objectclass=*", []): > x = hasLeaveEntry(name) > and so on... > else: > continue It's recursive which might be a problem on highly nested directory trees. Also I'd use the operational attribute 'hasSubordinates' if present or similar to spare the one search request per leaf entry. You might wanna check the sources of web2ldap which do the recursive deletes (file pylib/w2lapp/delete.py). Ciao, Michael. |
From: Lukas M. <lu...@ms...> - 2003-12-04 13:45:23
|
Hello, I want to show the whole tree with a for loop or anything else. I think it could work as follow: hasLeaveEntry() is a funktion that returns 0 or 1 if a subentry is there. for name, attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, "objectclass=*", []): x = hasLeaveEntry(name) if x == 1: for name, attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, "objectclass=*", []): x = hasLeaveEntry(name) and so on... else: continue But I want to write one, or two loops, which can show me every entry. For Example: Show first entry in base dc=x, if it has a leaveentry, show first entry in base dc=xx,dc=x and so on, or if not, show second entry in base dc=x, and again the same as above. However I can't get any loop working which is doing that as I described. Does anyone know a better technic oder anything else who might help me? Best regards Lukas |
From: <mi...@st...> - 2003-12-02 17:27:06
|
Find a new pre-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.0pre16 2003-12-02 Changes since 2.0.0pre15: Modules/: * Removed definition of unused constant RES_EXTENDED_PARTIAL since the corresponding symbol LDAP_RES_EXTENDED_PARTIAL seems to not be available in OpenLDAP-HEAD (pre 2.2) anymore. All in Lib/: * Fixed some subtle bugs/oddities mentioned by pychecker. dsml: * Renamed DSMLWriter._f to DSMLWriter._output_file * Added wrapper method DSMLWriter.unparse() which simply calls DSMLWriter.writeRecord() ldap.ldapobject: * Simplified LDAPObject.search_subschemasubentry_s() ldap.functions: * Moved ldap._ldap_function_call() into ldap.functions. * apply() is not used anymore since it seems deprecated ldap.async: * Added class DSMLWriter ldap.schema: * Removed unused key-word argument strict from ldap.schema.subentry.SubSchema.attribute_types() * Fixed backward compability issue (for Python prior to 2.2) in ldap.schema.subentry.SubSchema.listall() |
From: <pa...@su...> - 2003-11-28 16:20:15
|
Lukas Meyer wrote: > Hello, > Thank you for your help. > > That would be a great thing but I don't have this attribute. I don't get > this attribute with ldapsearch -h xx -D xx -b xx "objectclass=*" + Strange, I get: nil root # ldapsearch 'objectClass=*' + SASL/GSSAPI authentication started SASL username: root@B17 SASL SSF: 56 SASL installing layers # extended LDIF # # LDAPv3 # base <> with scope sub # filter: objectClass=* # requesting: + # # nil.b17 dn: dc=nil,dc=b17 structuralObjectClass: domain entryUUID: 5f869caa-b3c5-1027-8b0c-b3f8bb6957e2 creatorsName: cn=Manager,dc=nil,dc=b17 createTimestamp: 20031125190025Z entryCSN: 2003112519:00:25Z#0x0001#0#0000 modifiersName: cn=Manager,dc=nil,dc=b17 modifyTimestamp: 20031125190025Z subschemaSubentry: cn=Subschema hasSubordinates: TRUE Openldap 2.1.23, cyrus-sasl-2.1.15, mit-krb5-1.3 Most likely it is a problem with ACL's. Check if you can get the result when binding with your 'rootdn'. hth Paul |
From: <mi...@st...> - 2003-11-28 15:14:52
|
paul k=F6lle wrote: > Lukas Meyer wrote: >=20 >> I want to show the whole ldap structure in a tree. I want to do that=20 >> with a loop that continous searching in each branch it found. But my=20 >> problem is, how I can let the loop know if it is the end btw the last = >> branch of a branch. Is there anything to check for that? My current=20 >> code checks everytime the first branch, then the first branch of the=20 >> first branch etc. but if it is at the latest one, it hangs. So I need = >> anything how i can say "if you are in the latest one, break the loop".= >=20 > Just a thought, at least Openldap each entry has an operational=20 > attribute "hasSubordinates: TRUE | FALSE". This works on e.g. OpenLDAP (since 2.1.5?) and on some X.500 servers and = it's the most generic attribut for determining a leaf entry. One can also= =20 evaluate integer value of attribute 'subordinateCount' on Novell eDirecto= ry=20 or 'numSubordinates' on Netscape/iPlanet/SunONE Directory Server. Note th= at=20 the latter is not usable on iPlanet/SunONE Directory Server 5.x+ without = adding a-priori knowledge to the application that the attribute=20 'numSubordinates' should be there if it's a non-lead entry. web2ldap contains code for this when searching and doing recursive delete= s.=20 It also falls back to doing a one-level search when none of the attribute= s=20 above is present. Ciao, Michael. |
From: Lukas M. <lu...@ms...> - 2003-11-28 14:29:59
|
Hello, Thank you for your help. That would be a great thing but I don't have this attribute. I don't get=20 this attribute with ldapsearch -h xx -D xx -b xx "objectclass=3D*" + Is this attribute not implemented in the newer versions of openldap? Best regards Lukas paul k=F6lle wrote: Lukas Meyer wrote: > Hi there, > > I want to show the whole ldap structure in a tree. I want to do that=20 > with a loop that continous searching in each branch it found. But my=20 > problem is, how I can let the loop know if it is the end btw the last=20 > branch of a branch. Is there anything to check for that? My current=20 > code checks everytime the first branch, then the first branch of the=20 > first branch etc. but if it is at the latest one, it hangs. So I need=20 > anything how i can say "if you are in the latest one, break the loop". Just a thought, at least Openldap each entry has an operational=20 attribute "hasSubordinates: TRUE | FALSE". greetings Paul ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Python-LDAP-dev mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/python-ldap-dev |
From: <pa...@su...> - 2003-11-28 12:01:30
|
Lukas Meyer wrote: > Hi there, > > I want to show the whole ldap structure in a tree. I want to do that > with a loop that continous searching in each branch it found. But my > problem is, how I can let the loop know if it is the end btw the last > branch of a branch. Is there anything to check for that? My current code > checks everytime the first branch, then the first branch of the first > branch etc. but if it is at the latest one, it hangs. So I need anything > how i can say "if you are in the latest one, break the loop". Just a thought, at least Openldap each entry has an operational attribute "hasSubordinates: TRUE | FALSE". greetings Paul |
From: Lukas M. <lu...@ms...> - 2003-11-28 08:22:59
|
Hi there, I want to show the whole ldap structure in a tree. I want to do that with a loop that continous searching in each branch it found. But my problem is, how I can let the loop know if it is the end btw the last branch of a branch. Is there anything to check for that? My current code checks everytime the first branch, then the first branch of the first branch etc. but if it is at the latest one, it hangs. So I need anything how i can say "if you are in the latest one, break the loop". Below is a code snip of this loop: basedn = dn for name, attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, "objectclass=*", []): print name newdn = name while 1: for name, attrs in l.search_s(newdn, ldap.SCOPE_ONELEVEL, "objectclass=*"): newdn = name print newdn break Does anyone know a solution to this problem? Best regards Lukas |
From: <mi...@st...> - 2003-11-27 21:08:32
|
Cristian S. Rocha wrote: > > I'm here again. I would like to do more modifications but the async > module will change a lot, before I want to ask you what do you think > about some modifications. I already started a new module 'ldap.res' since I wanted to fix some mistakes I did in the design but keep the module ldap.async as is for not breaking existing code (mainly web2ldap and some sync scripts I've implemented for my customers). I think this is the way to go. From what I understand you're after the same thing like me: The data read by an arbitrary XReader should be piped to an arbitrary YWriter. With this you would be able to pump data from DSML to LDAP server, convert from LDIF to DSML, etc. Note that the Java implementation of Novell found on http://www.openldap.org implements classes with common interfaces. We might be able to borrow some ideas from this project. Also note that the modules 'ldif' and 'dsml' (and 'ldapurl') implemented in pure Python were designed to be usable stand-alone without importing anything from the rest of python-ldap. I found this handy on some platforms on which it's difficult to build the C wrapper part in cases I only needed a LDIF parser. So maybe best bet is to implement a new module package with interchangeable Reader/Writer classes and import and wrap the modules ldap, ldif and dsml. Not to forget implementing CSVReader/-Writer classes (with module 'csv' available in Python standard lib 2.3+). Speaking of module 'csv' it would also be nice to let the Reader classes implement the iterator interface available since Python 2.2. Look into the Python 2.3 'csv' docs to get the idea. I have currently no time do that myself but I'd be glad to review contributed code. How does that sound to you? Ciao, Michael. |
From: Joao S. O. B. <gw...@mp...> - 2003-11-27 15:15:04
|
Hi there, Well, I am also learning it. But it is troubleless with the method=20 add_s in the ldap object,=20 Just do l.add_s (dn_string, [ (attribute_name, attribute_value),=20 (attribute_name), (attribute_value)]) , being carefull to include all=20 the mandatory attributes for each objectClass. BTW objectClass itself=20 is a mandatory attribute. Check the error returned from the ldap (to learn, better, i usually do=20 these experiences in an interactive python shell), to see if any=20 attribute is missing. On Thursday 27 November 2003 11:43, Lukas Meyer wrote: > Hello, > > I want to add a whole entry to an ldap tree with python-ldap. But I > don't get any good result. I can add, replace, delete entries > without a problem and with the function delete_s() it's also > possible to delete a whole entry. But how can i add/create any > entry? I dont't want to add only an attribute. I.e. I want to add > cn=3DTest Person, ou=3DPersons, dc=3Ddomain. I can't find anything about > how to do that. Can anyone give me a hint for that? > > Best regards > > Lukas Meyer > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev =2D-=20 Este e-mail =E9, exceto pelas partes citadas de outros e-mails, copyright(c) de Jo=E3o Sebasti=E3o de Oliveira Bueno. Nenhuma c=F3pia deste e-mail ou=20 parte do mesmo pode existir nas depend=EAncias=20 de, ou em posse de funcion=E1rios, de associa=E7=F5es protetoras de direitos autorais Brasileiras, dos Estados Unidos da Am=E9rica, ou de outros pa=EDses. Em particular essa exce=E7=E3o do direito de leitura e posse deste e-mail se extende =E0 ABRA, ABPI, ABES, BSA, RIAA e MPAA. Violadores est=E3o infringindo as leis internacionais de=20 direitos autorais e sujeitos =E0s penalidades cab=EDveis. Voc=EA pode re-utilizar, emendar, acrescentar suas palavras e citar e re-enviar qualquer=20 parte do mesmo, desde que essa nota seja=20 preservada e se n=E3o pertencer a alguma das entidades supracitadas. |
From: <mi...@st...> - 2003-11-27 14:33:23
|
Lukas Meyer wrote: > > I want to add a whole entry to an ldap tree with python-ldap. That's what LDAPObject.add_s() is for. See Demo/simple.py for an example. Ciao, Michael. |
From: Cristian S. R. <cr...@dc...> - 2003-11-27 14:28:27
|
Hi, I'm here again. I would like to do more modifications but the async module will change a lot, before I want to ask you what do you think about some modifications. At now the async code is dependent to the format output: exists two classes to output ldif (ldif.LDIFWriter & ldap.async.LDIFWriter) and another two for dsml (dsml.DSMLWriter & ldap.async.DSMLWriter). I want to propose just one class for output (ldap.async.Writer) and other two for format considerations (dsml.DSMLWriter & ldif.LDIFWriter). That let you to output both format with less changes on the code. An example could be: """ format = { 'dsml': dsml.DSMLWriter(sys.stdout), 'ldif': ldif.LDIFWriter(sys.stdout), } def print(host, base, filtre, formatstr): s = ldap.async.Writer( ldap.initialize(host), format[formatstr] ) s.startSearch( base, ldap.SCOPE_SUBTREE, filtre ) """ To do it, the classes must share the following interface: """ class XWriter: def __init__(self, f, ...): """ Init the writer class. f file object for output. """ ... return def header(self): """ Return a header string. """ ... return '' def footer(self): """ Return a footer string. """ ... return '' def unparse(self, dn, entry): """ Write the entry to the object for output. dn string-representation of distinguished name entry dictionary holding the LDAP entry {attr:data} """ ... return """ I just append these functions (header & footer) to the LDIFWriter and DSMLWriter classes in "ldif.py" and "dsml.py" files. I append the async.Writer class to use the interface in the "async.py" file. And I test the code with the "Test.py" program. All the files are attached on the mail. Regards to all, Cristian. -- Lic. Cristian S. Rocha. <cr...@dc...> Departamento de Computacin. FCEyN. UBA. Pabellon I. Cuarto 9. Ciudad Universitaria. (1428) Buenos Aires. Argentina. Tel: +54-11-4576-3390/96 int 714 Tel/Fax: +54-11-4576-3359 Cel: 15-5-607-9192 |
From: Lukas M. <lu...@ms...> - 2003-11-27 13:43:48
|
Hello, I want to add a whole entry to an ldap tree with python-ldap. But I don't get any good result. I can add, replace, delete entries without a problem and with the function delete_s() it's also possible to delete a whole entry. But how can i add/create any entry? I dont't want to add only an attribute. I.e. I want to add cn=Test Person, ou=Persons, dc=domain. I can't find anything about how to do that. Can anyone give me a hint for that? Best regards Lukas Meyer |
From: <mi...@st...> - 2003-11-25 07:13:04
|
OHU...@sp... wrote: >=20 >>>>dn=3D"uid=3Dascii,l=3DM=FCnchen_iso-8859-1" >>>>ldap.explode_dn(dn) >=20 > ['uid=3Dascii'] Hmm, this looks wrong. Using ISO-8859-1 is wrong with LDAPv3 anyway. >>>>ldap.explode_dn(dn.decode('latin')) > [..] > UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in pos= ition 13: ordinal not in range(128) Off course you can't encode the raw string. dn is supposed to be an Unico= de=20 object. >>>>ldap.explode_dn(dn.decode('latin').encode('utf')) >=20 > ['uid=3Dascii', 'l=3DM\\C3\\BCnchen_iso-8859-1'] Now this shows that the underlying OpenLDAP function ldap_explode_dn() is= =20 aware of DN strings having to be UTF-8 encoded Unicode. Note that you SHOULD use 'utf-8' as unique ID for UTF-8. >>>>vgl=3Dldap.explode_dn(dn.decode('latin').encode('utf'))[1] >>>>vgl >=20 > 'l=3DM\\C3\\BCnchen_iso-8859-1' >=20 >>>>vgl=3D=3D"l=3DM=FCnchen_iso-8859-1".decode('latin').encode('utf8') >=20 > False The DN string normalization (with back slash representation) is done with= in=20 the OpenLDAP libs. The behaviour changed from OpenLDAP 2.0 to 2.1. I alre= ady=20 had a discussion with Kurt Z. about that. His argument was that LDAP=20 applications should treat DNs as being opaque. There's nothing we can do = about it. This breaks things when accessing OpenLDAP 2.0 server since 2.0= =20 did not implement correct matching rules for DNs. Oh yeah... > Beeing very RFC-strict I would have to use utf-8 encoding. But the resu= lt > also should be utf-8 encoded, which isn't the case. Any ideas? Input and output of ldap_explode_dn() both have to be a valid DN string=20 representation as of RFC2253 which is the case. Guess you have to live wi= th=20 that. Ciao, Michael. |
From: <OHU...@sp...> - 2003-11-24 18:41:22
|
Hello, since changing to python 2.3.2, OpenLDAP 2.1.23 and python-ldap-2.0.0pre15 I have problems with explode_dn(), related to diacritics; as You can see: Python 2.3.2 (#1, Oct 26 2003, 16:43:30) [GCC 3.3.1] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import ldap >>> dn="uid=ascii,l=München_iso-8859-1" >>> ldap.explode_dn(dn) ['uid=ascii'] >>> ldap.explode_dn(dn.decode('latin')) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/site-packages/ldap/functions.py", line 84, in explode_dn return _ldap_function_call(_ldap.explode_dn,dn,notypes) File "/usr/local/lib/python2.3/site-packages/ldap/__init__.py", line 62, in _ldap_function_call result = apply(func,args,kwargs) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 13: ordinal not in range(128) >>> ldap.explode_dn(dn.decode('latin').encode('utf')) ['uid=ascii', 'l=M\\C3\\BCnchen_iso-8859-1'] >>> vgl=ldap.explode_dn(dn.decode('latin').encode('utf'))[1] >>> vgl 'l=M\\C3\\BCnchen_iso-8859-1' >>> vgl=="l=München_iso-8859-1".decode('latin').encode('utf8') False In the last working versions, I didn't need to encode or decode the strings. Beeing very RFC-strict I would have to use utf-8 encoding. But the result also should be utf-8 encoded, which isn't the case. Any ideas? Kind Regards Eckard |
From: Jens V. <je...@zo...> - 2003-11-21 16:22:59
|
You could save yourself a lot of time by just giving it a try and seeing if it works. jens On Nov 21, 2003, at 9:28, Marc Petitmermet wrote: >>> gcc: unrecognized option `-R/usr/local/openldap/openldap-2.1.23/lib' >> I see that warning as well but the module builds just fine. Do you >> see the .so file or not? > > if you mean in build/lib.linux-i686-2.1? there is a _ldap.so. is this > o.k.? can i install now without regrets? > > regards, > marc > |