HI!
I have a problem splitting a DN with ldap_str2dn(). Actually I'm using it from python-ldap but judging from the debug output there does not seem to be an issue with passing the DN to the OpenLDAP API (see Python console output below).
Any clue what's wrong with this DN?
OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
BTW: Removing the spaces around , and + does not help either.
Ciao, Michael.
-------------------------------- snip --------------------------------
Python console:
ldap.set_option(ldap.OPT_DEBUG_LEVEL,65535) dn
'OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE'
ldap.dn.str2dn(dn)
=> ldap_bv2dn(OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE,0) ldap_err2string <= ldap_bv2dn(OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE)=-4 Decoding error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/ldap/dn.py", line 50, in str2dn return ldap.functions._ldap_function_call(_ldap.str2dn,dn,flags) File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 59, in _ldap_function_call result = func(*args,**kwargs) ldap.DECODING_ERROR
Michael Ströder wrote:
HI!
I have a problem splitting a DN with ldap_str2dn(). Actually I'm using it from python-ldap but judging from the debug output there does not seem to be an issue with passing the DN to the OpenLDAP API (see Python console output below).
Any clue what's wrong with this DN?
OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
BTW: Removing the spaces around , and + does not help either.
It appears to be LDAPv2 format. Did you specify that in the flags you passed to ldap_str2dn() ?
Ciao, Michael.
-------------------------------- snip --------------------------------
Python console:
ldap.set_option(ldap.OPT_DEBUG_LEVEL,65535) dn
'OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE'
ldap.dn.str2dn(dn)
=> ldap_bv2dn(OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE,0) ldap_err2string <= ldap_bv2dn(OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE)=-4 Decoding error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/ldap/dn.py", line 50, in str2dn return ldap.functions._ldap_function_call(_ldap.str2dn,dn,flags) File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 59, in _ldap_function_call result = func(*args,**kwargs) ldap.DECODING_ERROR
Howard Chu wrote:
It appears to be LDAPv2 format. Did you specify that in the flags you passed to ldap_str2dn() ?
Good catch! Michael, as a quick hint: you can use libraries/libldap/dntest to quickly check (schema unaware) DN parsing. In your case,
bash-3.00$ ./libraries/libldap/dntest 'OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE'
(no output)
bash-3.00$ ./libraries/libldap/dntest 'OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE' V2 ldap_rdn2str() = "0.2.262.1.10.7.20=1+CN=DIR DATEV D12 1:PN" ldap_rdn2str() = "O=DATEV eG" ldap_rdn2str() = "C=DE" ...
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------
Howard Chu wrote:
Michael Ströder wrote:
Any clue what's wrong with this DN?
OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
BTW: Removing the spaces around , and + does not help either.
It appears to be LDAPv2 format.
Because of prefix "OID."? It should be simply like this?
0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
Did you specify that in the flags you passed to ldap_str2dn() ?
No. Will try to extend python-ldap C Lib wrapper...
BTW: This is a probably quite old public OpenLDAP server:
ldap://ldap.nrca-ds.de
The connection is indeed a LDAPv3 connection. Will try to contact them to fix that broken installation.
Ciao, Michael.
Michael Ströder wrote:
Howard Chu wrote:
Michael Ströder wrote:
Any clue what's wrong with this DN?
OID.0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
BTW: Removing the spaces around , and + does not help either.
It appears to be LDAPv2 format.
Because of prefix "OID."? It should be simply like this?
0.2.262.1.10.7.20=1 + CN=DIR DATEV D12 1:PN, O=DATEV eG, C=DE
Yes, the "OID." prefix was only part of RFC1779, LDAPv2. It wasn't part of RFC2253; it's been gone for a long time.
Did you specify that in the flags you passed to ldap_str2dn() ?
No. Will try to extend python-ldap C Lib wrapper...
BTW: This is a probably quite old public OpenLDAP server:
ldap://ldap.nrca-ds.de
Judging from the supportedFeatures in the rootDSE, it may be 2.0.
The connection is indeed a LDAPv3 connection. Will try to contact them to fix that broken installation.
Ciao, Michael.
openldap-technical@openldap.org