summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-09-30 11:04:14 +0200
committerMartin Kosek <mkosek@redhat.com>2011-09-30 12:24:20 +0200
commit759ae9e2ef6ce9e4674177cb7892f0cc1c7186cd (patch)
treecef8d107892a1fab26e4abe1024f5d0de388c942
parentdabc6cd578b20ce4950d1e4052c0a814b8697ca9 (diff)
downloadfreeipa-759ae9e2ef6ce9e4674177cb7892f0cc1c7186cd.tar.gz
freeipa-759ae9e2ef6ce9e4674177cb7892f0cc1c7186cd.tar.xz
freeipa-759ae9e2ef6ce9e4674177cb7892f0cc1c7186cd.zip
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
-rw-r--r--ipalib/plugins/baseldap.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 11cd72cc0..20f23c2e0 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -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: