Skip to content

Commit

Permalink
[FIX] auth_ldap: fix authentication with special chars
Browse files Browse the repository at this point in the history
encode the filter in utf-8

This prevents a UnicodeDecode error in python-ldap when the
filter contains non ascii characters.

opw-682783
closes odoo#10899
closes odoo#12710
  • Loading branch information
gurneyalex authored and beledouxdenis committed Sep 28, 2016
1 parent 4ab34d4 commit 94f58d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/auth_ldap/users_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def authenticate(self, conf, login, password):
_logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.')
return False
try:
results = self.query(conf, filter)
results = self.query(conf, filter.encode('utf-8'))

# Get rid of (None, attrs) for searchResultReference replies
results = [i for i in results if i[0]]
Expand Down

0 comments on commit 94f58d6

Please sign in to comment.