summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-10-07 19:57:31 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-10-08 08:39:13 (GMT)
commit2985d66be1087bf73104f4e8320c5edd484c4ed8 (patch)
tree0c4de47b730c43d46e76dc802e37c1d079769105
parent6390a3f71ce8c17c0bf15e88b1b26e353cdc796d (diff)
downloadpratic-2985d66be1087bf73104f4e8320c5edd484c4ed8.zip
pratic-2985d66be1087bf73104f4e8320c5edd484c4ed8.tar.gz
pratic-2985d66be1087bf73104f4e8320c5edd484c4ed8.tar.bz2
Escape username before using it to build a DN
-rw-r--r--idp/extra/modules/store.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/idp/extra/modules/store.py b/idp/extra/modules/store.py
index c0d271b..2b007b7 100644
--- a/idp/extra/modules/store.py
+++ b/idp/extra/modules/store.py
@@ -46,7 +46,7 @@ class IdentitiesStorePratic:
def get_identity_for_account(self, username, password, collectivity):
store = directory.get_store()
ldap_conn = ldap.initialize(store.pratic_ldap_url)
- uid = 'uid=%s,%s' % (username, collectivity)
+ uid = 'uid=%s,%s' % (ldap.dn.escape_dn_chars(username)), collectivity)
try:
ldap_conn.simple_bind_s(uid, password)
except ldap.INVALID_DN_SYNTAX: