You are here: Home / Users / Oleg Lazo / OpenStack_for_ADC_EMC / keystone identity backend ldap patch

keystone identity backend ldap patch

by Oleg Lazo last modified Jun 15, 2014 09:29 PM

differences between files icon idn_ldap.py.patch — differences between files, 874 bytes

File contents

--- identity/backends/ldap.py~	2013-12-18 16:21:44.000000000 +0400
+++ identity/backends/ldap.py	2014-06-15 22:19:57.675983975 +0400
@@ -17,6 +17,7 @@
 import uuid
 
 import ldap
+import ldap.filter
 
 from keystone import clean
 from keystone.common import dependency
@@ -326,10 +327,10 @@
 
     def list_user_groups(self, user_dn):
         """Return a list of groups for which the user is a member."""
-
+	user_dn_esc = ldap.filter.escape_filter_chars(user_dn)
         query = '(&(objectClass=%s)(%s=%s)%s)' % (self.object_class,
                                                   self.member_attribute,
-                                                  user_dn,
+                                                  user_dn_esc,
                                                   self.filter or '')
         memberships = self.get_all(query)
         return memberships