mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 17:34:21 +01:00
fix encoding error on dn
This commit is contained in:
parent
b9903e62ff
commit
4e5591db7a
@ -234,7 +234,7 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
return s.encode('utf-8')
|
return s.encode('utf-8')
|
||||||
|
|
||||||
def _uni(self, s):
|
def _uni(self, s):
|
||||||
return s.decode('utf-8')
|
return s.decode('utf-8', 'ignore')
|
||||||
|
|
||||||
def auth(self, username, password):
|
def auth(self, username, password):
|
||||||
|
|
||||||
@ -256,11 +256,12 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
attrs_str = {}
|
attrs_str = {}
|
||||||
for a in attrs:
|
for a in attrs:
|
||||||
attrs_str[self._str(a)] = self._str(attrs[a])
|
attrs_str[self._str(a)] = self._str(attrs[a])
|
||||||
|
|
||||||
attrs_str['objectClass'] = self.objectclasses
|
attrs_str['objectClass'] = self.objectclasses
|
||||||
dn = \
|
dn = \
|
||||||
self.dn_user_attr +\
|
self.dn_user_attr +\
|
||||||
'=' +\
|
'=' +\
|
||||||
attrs[self.dn_user_attr] +\
|
self._str(attrs[self.dn_user_attr]) +\
|
||||||
',' +\
|
',' +\
|
||||||
self.userdn
|
self.userdn
|
||||||
ldif = modlist.addModlist(attrs_str)
|
ldif = modlist.addModlist(attrs_str)
|
||||||
|
Loading…
Reference in New Issue
Block a user