amoralej / rpms / 389-ds-base

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

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

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