zrhoffman / rpms / 389-ds-base

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

Blame SOURCES/0063-Ticket-48266-Online-init-crashes-consumer.patch

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