0001-ldap_backend-fail-login-if-attribute-retrieval-fails.patch
src/authentic2/backends/ldap_backend.py | ||
---|---|---|
193 | 193 | |
194 | 194 |
def get_attributes(self): |
195 | 195 |
conn = self.get_connection() |
196 |
return self.ldap_backend.get_ldap_attributes(self.block, conn, self.dn) |
|
196 |
return self.ldap_backend.get_ldap_attributes(self.block, conn, self.dn) or {}
|
|
197 | 197 | |
198 | 198 |
def save(self, *args, **kwargs): |
199 | 199 |
if hasattr(self, 'keep_pk'): |
... | ... | |
676 | 676 |
results = conn.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', attributes) |
677 | 677 |
except ldap.LDAPError: |
678 | 678 |
log.exception('unable to retrieve attributes of dn %r', dn) |
679 |
return {}
|
|
679 |
return None
|
|
680 | 680 |
attribute_map = cls.normalize_ldap_results(results[0][1]) |
681 | 681 |
# add mandatory attributes |
682 | 682 |
for key, mandatory_values in mandatory_attributes_values.iteritems(): |
683 |
- |