mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Raise proper exception when LDAP limits are exceeded
ldap2 plugin returns NotFound error for find_entries/get_entry queries when the server did not manage to return an entry due to time limits. This may be confusing for user when the entry he searches actually exists. This patch fixes the behavior in ldap2 plugin to 1) Return even a zero search results + truncated bool set in ldap2.find_entries 2) Raise LimitsExceeded in ldap2.get_entry and ldap2.find_entry_by_attr instead of NotFound error This changed several assumptions about ldap2.find_entries results. Several calls accross IPA code base had to be amended. https://fedorahosted.org/freeipa/ticket/2606
This commit is contained in:
committed by
Rob Crittenden
parent
adf16a9b1c
commit
a663e83cb2
@@ -724,6 +724,8 @@ class automountkey(LDAPObject):
|
||||
basedn, _ldap.SCOPE_ONELEVEL)
|
||||
if len(entries) > 1:
|
||||
raise errors.NotFound(reason=_('More than one entry with key %(key)s found, use --info to select specific entry.') % dict(key=pkey))
|
||||
if truncated:
|
||||
raise errors.LimitsExceeded()
|
||||
dn = entries[0][0]
|
||||
|
||||
return dn
|
||||
|
||||
Reference in New Issue
Block a user