浏览代码

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 年之前
父节点
当前提交
50c05b4be3
共有 1 个文件被更改,包括 2 次插入1 次删除
  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
         }