dataflake.org

Home Documentation Software Old Stuff

dn's containing ',' character are improperly delt with (Resolved)

Request LDAP User Folder -- bug report -- by Russell Sim
Posted on Sep 24, 2008 8:20 pm
Subscribe

Enter your email address to receive mail on every change to this issue.

Entries (Latest first)


  Resolve by Jens Vagelpohl on Sep 25, 2008 11:05 am
  Thanks for the patch, I have added suitable tests and checked it in:

http://svn.dataflake.org/viewvc?view=rev&revision=1628

 

  Initial Request by Russell Sim on Sep 24, 2008 8:20 pm
  I am currently dealing with an ldap server which contains dn's like this

cn=Mark Smith, ou="Faculty of Medicine, Nursing and Health Sciences", ou=Staff, o=University, c=au

So when the escaping occurs within the _clean_dn function, the dn is split on the character ',' which doesn't work because it's part of the ou section. So using the explode_dn function solves this by more accurately separating the sections of the dn.

comma is a valid character according to RFC 2253

diff --git a/Products/LDAPUserFolder/LDAPDelegate.py b/Products/LDAPUserFolder/LDAPDelegate.py
index 4ac469a..044b91b 100644
--- a/Products/LDAPUserFolder/LDAPDelegate.py
+++ b/Products/LDAPUserFolder/LDAPDelegate.py
@@ -621,7 +621,7 @@ class LDAPDelegate(Persistent):

def _clean_dn(self, dn):
""" Escape all characters that need escaping for a DN, see RFC 2253 """
- elems = [self._clean_rdn(x) for x in dn.split(',')]
+ elems = [self._clean_rdn(x) for x in self.explode_dn(dn)]

return ','.join(elems)