andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 11f1cb86ed566729bd4806868a3c6beadc4a8013 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 14 Apr 2014 15:49:33 -0400
Subject: [PATCH 200/225] Ticket 47736 - Import incorrectly updates
 numsubordinates for tombstone entries

Bug Description:  Imports incorrectly updates numsubordinates when processing
                  tombstone entries.

Fix Description:  Fix the logic in the condition test for updating parentid.

https://fedorahosted.org/389/ticket/47736

Reviewed by: rmeggins & nhosoi(Thanks!!)
(cherry picked from commit 73d63726151dedd930f1ad3bbd2dd050506a57d9)
---
 ldap/servers/slapd/back-ldbm/import-threads.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index d30936e..e615bb1 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -2349,9 +2349,9 @@ import_foreman(void *param)
             goto error;
         }
 
-        if (entryrdn_get_switch() /* subtree-rename: on */ ||
-            !slapi_entry_flag_is_set(fi->entry->ep_entry,
-                                     SLAPI_ENTRY_FLAG_TOMBSTONE)) {
+        if ((entryrdn_get_switch() /* subtree-rename: on */ &&
+             !slapi_entry_flag_is_set(fi->entry->ep_entry, SLAPI_ENTRY_FLAG_TOMBSTONE)) ||
+            !entryrdn_get_switch() ) {
             /* parentid index
              * (we have to do this here, because the parentID is dependent on
              * looking up by entrydn/entryrdn.)
@@ -2362,7 +2362,7 @@ import_foreman(void *param)
             if (ret != 0)
                 goto error;
         }
-            
+
         if (!slapi_entry_flag_is_set(fi->entry->ep_entry,
                                      SLAPI_ENTRY_FLAG_TOMBSTONE)) {
             /* Lastly, before we're finished with the entry, pass it to the 
-- 
1.8.1.4