Fix group lookup when AD DNS Referal is in lookup path
Fix an issue when the DNS AD referal is in the path. An Exception is raised, with the following stacktrace:: Traceback (most recent call last): File "/www/lemur/lemur/auth/views.py", line 317, in post user = ldap_principal.authenticate() File "/www/lemur/lemur/auth/ldap.py", line 147, in authenticate self._bind() File "/www/lemur/lemur/auth/ldap.py", line 216, in _bind self.ldap_groups.append(values["cn"][0].decode("ascii")) TypeError: list indices must be integers or slices, not str This is issue is trigerred by some extra rows that referrences the DNS subtree:: ['ldaps://DomainDnsZones.xxxx'] Limiting the extraction to the expected dicts fix this issue.
This commit is contained in:
parent
cafc2c1d80
commit
57208fe198
|
@ -210,6 +210,7 @@ class LdapPrincipal:
|
||||||
self.ldap_groups = []
|
self.ldap_groups = []
|
||||||
for group in lgroups:
|
for group in lgroups:
|
||||||
(dn, values) = group
|
(dn, values) = group
|
||||||
|
if type(values) == dict:
|
||||||
self.ldap_groups.append(values["cn"][0].decode("ascii"))
|
self.ldap_groups.append(values["cn"][0].decode("ascii"))
|
||||||
else:
|
else:
|
||||||
lgroups = self.ldap_client.search_s(
|
lgroups = self.ldap_client.search_s(
|
||||||
|
|
Loading…
Reference in New Issue