We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An ldap search in a Samba 4 LDAP directory returns DN's containing a ? escaped as \?. This fails to get parsed:
?
\?
>>> import ldap.dn >>> ldap.dn.str2dn('cn=foo\\?,dc=base') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/ldap/dn.py", line 53, in str2dn return ldap.functions._ldap_function_call(None,_ldap.str2dn,dn,flags) File "/usr/lib/python2.7/dist-packages/ldap/functions.py", line 66, in _ldap_function_call result = func(*args,**kwargs) ldap.DECODING_ERROR
As a workaround I am using a function like:
def str2dn(dn): try: return ldap.dn.str2dn(dn) except ldap.DECODING_ERROR: return ldap.dn.str2dn(dn.replace('\\?', '?'))
Just wanted to let you know. I am unsure If this is an error in the Samba 4 LDAP implementation or if this is acutally allowed LDAP syntax.
The text was updated successfully, but these errors were encountered:
Maybe related to: #257
Sorry, something went wrong.
I would compare vs OpenLDAP's behavior with a similar DN.
Please report this bug with OpenLDAP. python-ldap uses libldap's ldap_bv2dn() to parse the string.
ldap_bv2dn()
I created a bug at Samba: https://bugzilla.samba.org/show_bug.cgi?id=14073
No branches or pull requests
An ldap search in a Samba 4 LDAP directory returns DN's containing a
?
escaped as\?
.This fails to get parsed:
As a workaround I am using a function like:
Just wanted to let you know. I am unsure If this is an error in the Samba 4 LDAP implementation or if this is acutally allowed LDAP syntax.
The text was updated successfully, but these errors were encountered: