ldap/admin/src/scripts/DSUtil.pm.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 50c05b4be3792af3d3726a130984395b8059a762
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon Aug 25 13:04:57 2014 +0200
Ticket 47877 - check_and_add_entry fails for changetype: add and existing entry
Bug Description: If an ldif file in the updates directory contains
changetype: add, the add fails if the entry
already exist
Fix Description: ignore existing entries also in case of
explicite changetype
https://fedorahosted.org/389/ticket/47877
Reviewed by: ?
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index d40d889..818fafa 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -406,7 +406,8 @@ sub check_and_add_entry
my $sentry = $conn->search($aentry->{dn}, "base",
"(objectclass=*)", 0, ("*", "aci"));
if ($sentry) {
debug(3, "check_and_add_entry: Found entry " . $sentry->getDN() .
"\n");
- if (! @ctypes) { # entry exists, and this is not a modify op
+ if ( (! @ctypes) or ("add" eq lc($ctypes[0])) ) { # entry exists, and
this is not a modify op
+ # or add is explicitely specified
debug(3, "check_and_add_entry: skipping entry " .
$sentry->getDN() . "\n");
return 1; # ignore - return success
}