1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-25 18:54:29 +01:00

fix encoding error on dn

This commit is contained in:
kakwa 2015-07-28 22:18:57 +02:00
parent b9903e62ff
commit 4e5591db7a

View File

@ -234,7 +234,7 @@ class Backend(ldapcherry.backend.Backend):
return s.encode('utf-8')
def _uni(self, s):
return s.decode('utf-8')
return s.decode('utf-8', 'ignore')
def auth(self, username, password):
@ -256,11 +256,12 @@ class Backend(ldapcherry.backend.Backend):
attrs_str = {}
for a in attrs:
attrs_str[self._str(a)] = self._str(attrs[a])
attrs_str['objectClass'] = self.objectclasses
dn = \
self.dn_user_attr +\
'=' +\
attrs[self.dn_user_attr] +\
self._str(attrs[self.dn_user_attr]) +\
',' +\
self.userdn
ldif = modlist.addModlist(attrs_str)