zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone

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

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