소스 검색

[useradmin] Sanitization process added to groups

The same sanitization process we do in users we run into in groups so the fix needs to be applied there additionally
Scott Kahler 10 년 전
부모
커밋
dbafb1c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      apps/useradmin/src/useradmin/ldap_access.py

+ 2 - 0
apps/useradmin/src/useradmin/ldap_access.py

@@ -327,6 +327,8 @@ class LdapConnection(object):
 
     # Allow wild cards on non distinguished names
     sanitized_name = ldap.filter.escape_filter_chars(groupname_pattern).replace(r'\2a', r'*')
+    # Fix issue where \, is converted to \5c,
+    sanitized_name = sanitized_name.replace(r'\5c,', r'\2c')
     search_dn, group_name_filter = self._get_search_params(sanitized_name, search_attr, find_by_dn)
     ldap_filter = '(&' + group_filter + group_name_filter + ')'
     attrlist = ['objectClass', 'dn', 'memberUid', group_member_attr, group_name_attr]