From: <mi...@st...> - 2007-03-20 20:55:50
|
HI! I'd like to release python-ldap 2.3 within the next weeks. For this release I'd like to get rid of using deprecated OpenLDAP C SDK functions. Since my C skills are limited I'd appreciate if somebody could take over implementing a new C function l_ldap_str2dn(). I've collected my thoughts in the SF tracker item SF#1657848 (see current content below). Ciao, Michael. -- Michael Ströder E-Mail: mi...@st... http://www.stroeder.com -------- Original Message -------- Subject: [ python-ldap-Bugs-1657848 ] ldap_value_free() deprecated Date: Sun, 18 Mar 2007 04:49:49 -0700 From: SourceForge.net <no...@so...> To: no...@so... Bugs item #1657848, was opened at 2007-02-12 11:16 Message generated for change (Comment added) made by stroeder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102072&aid=1657848&group_id=2072 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 8 Private: No Submitted By: Michael Ströder (stroeder) Assigned to: Nobody/Anonymous (nobody) Summary: ldap_value_free() deprecated Initial Comment: Current ldap.h lists ldap_value_free() as deprecated. ldap_values_free_len() shall be used instead. ---------------------------------------------------------------------- >Comment By: Michael Ströder (stroeder) Date: 2007-03-18 12:49 Message: Logged In: YES user_id=64920 Originator: YES Hmm, since Python strings are similar to struct berval probably OpenLDAP's function ldap_bv2dn() should be used instead ldap_str2dn() within l_ldap_str2dn(). ---------------------------------------------------------------------- Comment By: Michael Ströder (stroeder) Date: 2007-03-18 11:52 Message: Logged In: YES user_id=64920 Originator: YES It seems ldap_value_free() is solely used in l_ldap_explode_dn() and ldap_explode_rdn(). These functions in turn use OpenLDAP's functions ldap_explode_dn() and ldap_explode_rdn() which are also marked as deprecated. So the best thing is for upcoming python-ldap 2.3 1. to add a new function l_ldap_str2dn() to functions.c, 2. add a new Python wrapper function str2dn() to Lib/ldap/functions.py, 3. to remove l_ldap_explode_dn() and ldap_explode_rdn() from functions.c and 4. modify pure Python wrapper function explode_dn() and explode_rdn() in ldap.functions to use the new Python function ldap.functions.str2dn() for preserving backward compability. This might change the behaviour of ldap.explode_dn() to return hex-escaped chars for NON-ASCII chars. This is odd anyway so personally I don't care. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102072&aid=1657848&group_id=2072 |
From: Alain S. <asp...@gm...> - 2007-03-22 15:02:58
|
I'll take a look this weekend and help if I can On 3/20/07, Michael Str=F6der <mi...@st...> wrote: > > HI! > > I'd like to release python-ldap 2.3 within the next weeks. For this > release I'd like to get rid of using deprecated OpenLDAP C SDK functions. > > Since my C skills are limited I'd appreciate if somebody could take over > implementing a new C function l_ldap_str2dn(). I've collected my > thoughts in the SF tracker item SF#1657848 (see current content below). > > Ciao, Michael. > > -- > Michael Str=F6der > E-Mail: mi...@st... > http://www.stroeder.com > > -------- Original Message -------- > Subject: [ python-ldap-Bugs-1657848 ] ldap_value_free() deprecated > Date: Sun, 18 Mar 2007 04:49:49 -0700 > From: SourceForge.net <no...@so...> > To: no...@so... > > Bugs item #1657848, was opened at 2007-02-12 11:16 > Message generated for change (Comment added) made by stroeder > You can respond by visiting: > > https://sourceforge.net/tracker/?func=3Ddetail&atid=3D102072&aid=3D165784= 8&group_id=3D2072 > > Please note that this message will contain a full copy of the comment > thread, > including the initial issue submission, for this request, > not just the latest update. > Category: None > Group: None > Status: Open > Resolution: None > Priority: 8 > Private: No > Submitted By: Michael Str=F6der (stroeder) > Assigned to: Nobody/Anonymous (nobody) > Summary: ldap_value_free() deprecated > > Initial Comment: > Current ldap.h lists ldap_value_free() as deprecated. > ldap_values_free_len() shall be used instead. > > ---------------------------------------------------------------------- > > >Comment By: Michael Str=F6der (stroeder) > Date: 2007-03-18 12:49 > > Message: > Logged In: YES > user_id=3D64920 > Originator: YES > > Hmm, since Python strings are similar to struct berval probably OpenLDAP'= s > function ldap_bv2dn() should be used instead ldap_str2dn() within > l_ldap_str2dn(). > > ---------------------------------------------------------------------- > > Comment By: Michael Str=F6der (stroeder) > Date: 2007-03-18 11:52 > > Message: > Logged In: YES > user_id=3D64920 > Originator: YES > > It seems ldap_value_free() is solely used in l_ldap_explode_dn() and > ldap_explode_rdn(). These functions in turn use OpenLDAP's functions > ldap_explode_dn() and ldap_explode_rdn() which are also marked as > deprecated. > > So the best thing is for upcoming python-ldap 2.3 > 1. to add a new function l_ldap_str2dn() to functions.c, > 2. add a new Python wrapper function str2dn() to Lib/ldap/functions.py, > 3. to remove l_ldap_explode_dn() and ldap_explode_rdn() from functions.c > and > 4. modify pure Python wrapper function explode_dn() and explode_rdn() in > ldap.functions to use the new Python function ldap.functions.str2dn() for > preserving backward compability. > > This might change the behaviour of ldap.explode_dn() to return hex-escape= d > chars for NON-ASCII chars. This is odd anyway so personally I don't care. > > ---------------------------------------------------------------------- > > You can respond by visiting: > > https://sourceforge.net/tracker/?func=3Ddetail&atid=3D102072&aid=3D165784= 8&group_id=3D2072 > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev > --=20 -- Alain Spineux aspineux gmail com May the sources be with you |
From: <mi...@st...> - 2007-03-22 19:50:08
|
David Leonard wrote: > here's my hackery so far.. doesn't seem to work completely though... David, glad to here from you! Even more glad to receive some code for python-ldap! > this is how I test: > $ python setup.py build > $ PYTHONPATH=build/lib.openbsd-4.0-i386-2.3/ python -c 'import _ldap; > print _ldap.dn2str(_ldap.str2dn("a=b,c=d;e=f"))' 1. Do we really need to expose OpenLDAP constants LDAP_DN_* etc. you introduced in constants.c at the python-ldap's API? I'd rather vote to through out some already existing constants since they are not needed for Python applications. For the ease of maintenance I'd like to keep the C part under Modules/ as sparse as possible. 2. The new functions: >>> import _ldap >>> _ldap.str2dn('cn=Michael Ströder,o=Blurb\, Co.') [[('cn', 'Michael Str\xc3\xb6der', 4)], [('o', 'Blurb, Co.', 1)]] What are the numbers? Some flags in an integer? Further trails with dn2str(): >>> print _ldap.dn2str([[('cn', 'Michael Str\xc3\xb6der', 4)], [('o', 'Blurb, Co.', 1)]]) Modules/functions.c:160 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function takes exactly 1 argument (3 given) >>> print _ldap.dn2str([[('cn', 'Michael Str\xc3\xb6der')], [('o', 'Blurb, Co.')]]) Modules/functions.c:160 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function takes exactly 1 argument (2 given) >>> print _ldap.dn2str([[('cn=Michael Str\xc3\xb6der')], [('o=Blurb, Co.')]]) Modules/functions.c:160 Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: new style getargs format but argument is not a tuple >>> print _ldap.dn2str([['cn=Michael Str\xc3\xb6der'], ['o=Blurb, Co.']]) Modules/functions.c:160 Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: new style getargs format but argument is not a tuple >>> print _ldap.dn2str(['cn=Michael Str\xc3\xb6der','o=Blurb, Co.']) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: ("expected seq of seq of '2+'-seq", ['cn=Michael Str\xc3\xb6der', 'o=Blurb, Co.']) >>> ??????? > ps - my mails to the dev list don't seem to be getting through .. i'll > have to look at that :) I had this also (see below). Maybe my provider fixed it... <pyt...@li...>: host mail.sourceforge.net[66.35.250.206] said: 550-Callback setup failed while verifying <mi...@st...> 550-Called: 81.169.145.100 550-Sent: MAIL FROM:<> 550-Response: 503 5.1.8 Postmaster not allowed 550-The initial connection, or a HELO or MAIL FROM:<> command was 550-rejected. Refusing MAIL FROM:<> does not help fight spam, disregards 550-RFC requirements, and stops you from receiving standard bounce 550-messages. This host does not accept mail from domains whose servers 550-refuse bounces. 550 Sender verify failed (in reply to RCPT TO command) Ciao, Michael. |
From: <mi...@st...> - 2007-03-22 21:45:17
|
David, hope you don't mind that I'm Cc:-ing the list. David Leonard wrote: > > Mmm as LDAPDN doesn't seem to be used in any other part of the C API, At Python level I don't care about LDAPDN at all. > Maybe just move the explode_* impl out into python code.. That's what I'm currently doing. Other issues: $ python -c "import _ldap;print _ldap.str2dn('')" Segmentation fault $ python -c "import _ldap;print _ldap.str2dn('c=')" [[('c', None, 1)]] ^^^^ IMHO this should be ''. Ciao, Michael. |
From: <mi...@st...> - 2007-03-22 22:08:15
|
David, I've committed various changes related to this. Everybody please test. Despite the corner-cases listed before ldap.explode_dn() and ldap.explode_rdn() should work nearly as before. Ciao, Michael. |
From: <mi...@st...> - 2007-03-22 20:17:13
|
Michael Ströder wrote: > Further trails with dn2str(): Frankly we don't need l_ldap_dn2str() at all. We can easily write efficient pure Python code for it with '='.join() etc. Well, ldap.dn.escape_dn_chars() could need a C part for performance. Ciao, Michael. |
From: <mi...@st...> - 2007-03-22 23:18:18
|
Michael Ströder wrote: > > Frankly we don't need l_ldap_dn2str() at all. We can easily write > efficient pure Python code for it with '='.join() etc. See pure Python implementation ldap.dn.dn2str() in HEAD. Well, this function name is somewhat misleading but let's stick to OpenLDAP's naming convention here. Ciao, Michael. |