Răsfoiți Sursa

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: ?
Ludwig Krispenz 11 ani în urmă
părinte
comite
50c05b4be3
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      ldap/admin/src/scripts/DSUtil.pm.in

+ 2 - 1
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
         }