Procházet zdrojové kódy

HUE-978 [useradmin] Base DN needs to to have components capitalized when comparing with searcn DN.

abec před 13 roky
rodič
revize
14a32a11eb
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      apps/useradmin/src/useradmin/ldap_access.py

+ 1 - 1
apps/useradmin/src/useradmin/ldap_access.py

@@ -93,7 +93,7 @@ class LdapConnection(object):
     if find_by_dn:
       search_dn = re.sub(r'(\w+=)', lambda match: match.group(0).upper(), name)
 
-      if not search_dn.endswith(base_dn):
+      if not search_dn.endswith(re.sub(r'(\w+=)', lambda match: match.group(0).upper(), base_dn)):
         raise RuntimeError("Distinguished Name provided does not contain configured Base DN. Base DN: %(base_dn)s, DN: %(dn)s" % {
           'base_dn': base_dn,
           'dn': search_dn