mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix LDAPCreate search failure
LDAPCreate reports "search criteria was not specific enough" when LDAP object created in LDAPCreate shares its container with other LDAP objects and there is one with the same name and RDN attribute. Pass objectclass to find_entry_by_attr() function used to retrieve newly created object for POST_CALLBACK to identify correct LDAP object. https://fedorahosted.org/freeipa/ticket/1864
This commit is contained in:
@@ -739,8 +739,13 @@ class LDAPCreate(CallbackInterface, crud.Create):
|
||||
|
||||
try:
|
||||
if self.obj.rdn_attribute:
|
||||
# make sure objectclass is either set or None
|
||||
if self.obj.object_class:
|
||||
object_class = self.obj.object_class
|
||||
else:
|
||||
object_class = None
|
||||
(dn, entry_attrs) = ldap.find_entry_by_attr(
|
||||
self.obj.primary_key.name, keys[-1], None, attrs_list,
|
||||
self.obj.primary_key.name, keys[-1], object_class, attrs_list,
|
||||
self.obj.container_dn
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user