Blame SOURCES/0082-Ticket-49431-replicated-MODRDN-fails-breaking-replic.patch

6f51e1
From 557f4d4ed5e37f09691d383dd8189b642ade8f2b Mon Sep 17 00:00:00 2001
6f51e1
From: Ludwig Krispenz <lkrispen@redhat.com>
6f51e1
Date: Sun, 29 Oct 2017 16:32:11 +0100
6f51e1
Subject: [PATCH] Ticket 49431 - replicated MODRDN fails breaking replication
6f51e1
6f51e1
Bug: in urp modrdn_operation not a full dn was passed to generate the conflict rdn passed
6f51e1
    and so the sufix test failed
6f51e1
6f51e1
Fix: provide full dn of new entry
6f51e1
6f51e1
Reviewed by: Mark, Thanks
6f51e1
---
6f51e1
 ldap/servers/plugins/replication/urp.c | 9 ++++++++-
6f51e1
 1 file changed, 8 insertions(+), 1 deletion(-)
6f51e1
6f51e1
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
6f51e1
index 64810e9d4..21319d9f7 100644
6f51e1
--- a/ldap/servers/plugins/replication/urp.c
6f51e1
+++ b/ldap/servers/plugins/replication/urp.c
6f51e1
@@ -433,7 +433,14 @@ urp_modrdn_operation( Slapi_PBlock *pb )
6f51e1
 			/* The target entry is a loser */
6f51e1
 
6f51e1
 			char *newrdn_with_uniqueid;
6f51e1
-			newrdn_with_uniqueid= get_rdn_plus_uniqueid (sessionid, newrdn, op_uniqueid);
6f51e1
+			char *newdn = NULL;
6f51e1
+                        if (new_parent_entry) {
6f51e1
+                            newdn = slapi_ch_smprintf("%s,%s", newrdn, slapi_entry_get_dn(new_parent_entry));
6f51e1
+                        } else {
6f51e1
+                            newdn = slapi_ch_smprintf("%s,%s", newrdn, slapi_entry_get_dn(parent_entry));
6f51e1
+                        }
6f51e1
+			newrdn_with_uniqueid= get_rdn_plus_uniqueid (sessionid, newdn, op_uniqueid);
6f51e1
+			slapi_ch_free_string(&newdn);
6f51e1
 			if(newrdn_with_uniqueid==NULL)
6f51e1
 			{
6f51e1
 				op_result= LDAP_OPERATIONS_ERROR;
6f51e1
-- 
6f51e1
2.13.6
6f51e1