andykimpe / rpms / 389-ds-base

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

Blame 0340-Ticket-48266-Online-init-crashes-consumer.patch

dc8c34
From 046bf5b22c0dda652c2ccf4ae112f70fd27718e8 Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Tue, 22 Sep 2015 09:49:12 -0400
dc8c34
Subject: [PATCH 340/342] Ticket 48266 - Online init crashes consumer
dc8c34
dc8c34
Bug Description:  When trying to create the 'replica keep alive' entry
dc8c34
                  on a consumer during an online init, the entry gets freed
dc8c34
                  in op_shared_add(), and then freed again in
dc8c34
                  replica_subentry_create() which leads to a crash.
dc8c34
dc8c34
Fix Description:  Do not free the "keep alive" entry if a referral is
dc8c34
                  returned when trying to create the keep-alive entry.
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/48266
dc8c34
dc8c34
Reviewed by: tbordaz(Thanks!)
dc8c34
dc8c34
(cherry picked from commit 5538bac519c5363bb456e98d615c9366dedd57d8)
dc8c34
(cherry picked from commit 3896e68cd2ee56df7bcc95add500fee56733d62c)
dc8c34
---
dc8c34
 ldap/servers/plugins/replication/repl5_replica.c | 4 +++-
dc8c34
 1 file changed, 3 insertions(+), 1 deletion(-)
dc8c34
dc8c34
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
dc8c34
index 84539d2..20b5ab1 100644
dc8c34
--- a/ldap/servers/plugins/replication/repl5_replica.c
dc8c34
+++ b/ldap/servers/plugins/replication/repl5_replica.c
dc8c34
@@ -432,7 +432,9 @@ replica_subentry_create(Slapi_DN *repl_root, ReplicaId rid)
dc8c34
             repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0 /* flags */);
dc8c34
     slapi_add_internal_pb(pb);
dc8c34
     slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &return_value);
dc8c34
-    if (return_value != LDAP_SUCCESS && return_value != LDAP_ALREADY_EXISTS) 
dc8c34
+    if (return_value != LDAP_SUCCESS &&
dc8c34
+        return_value != LDAP_ALREADY_EXISTS &&
dc8c34
+        return_value != LDAP_REFERRAL /* CONSUMER */)
dc8c34
     {
dc8c34
         slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: unable to "
dc8c34
                 "create replication keep alive entry %s: %s\n", slapi_entry_get_dn_const(e),
dc8c34
-- 
dc8c34
1.9.3
dc8c34