summaryrefslogtreecommitdiffstats
path: root/ipalib
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:39 +0200
commit7c884f1205916cca4c683b9ba8dd823d7f934aaa (patch)
treeb51cd5b728649cb5e237a5b37b4afa4e1454e996 /ipalib
parent1e2c0562834d0ee3c3a7a815f5449befa4797a5a (diff)
downloadfreeipa-7c884f1205916cca4c683b9ba8dd823d7f934aaa.tar.gz
freeipa-7c884f1205916cca4c683b9ba8dd823d7f934aaa.tar.xz
freeipa-7c884f1205916cca4c683b9ba8dd823d7f934aaa.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
Diffstat (limited to 'ipalib')
-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: