Merge pull request #3237 from ExaneServerTeam/bugfix/group-lookup-fix-referral

Fix group lookup when AD DNS Referal is in lookup path
This commit is contained in:
Hossein Shafagh 2020-11-09 14:38:12 -08:00 committed by GitHub
commit f42d9539fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,8 @@ class LdapPrincipal:
self.ldap_groups = [] self.ldap_groups = []
for group in lgroups: for group in lgroups:
(dn, values) = group (dn, values) = group
self.ldap_groups.append(values["cn"][0].decode("ascii")) if type(values) == dict:
self.ldap_groups.append(values["cn"][0].decode("ascii"))
else: else:
lgroups = self.ldap_client.search_s( lgroups = self.ldap_client.search_s(
self.ldap_base_dn, ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs self.ldap_base_dn, ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs