Blame SOURCES/0081-Ticket-47620-Unable-to-delete-protocol-timeout-attri.patch

cc3dff
From 5a79c1ecc7e706202a2a668e6cb12624f302ed35 Mon Sep 17 00:00:00 2001
cc3dff
From: Mark Reynolds <mreynolds@redhat.com>
cc3dff
Date: Fri, 17 Jan 2014 15:13:21 -0500
cc3dff
Subject: [PATCH 81/83] Ticket 47620 - Unable to delete protocol timeout
cc3dff
 attribute
cc3dff
cc3dff
Bug Description:  Attempting to delete nsds5ReplicaProtocolTimeout from a replication
cc3dff
                  agreement unexpectedly fails with an error 53.
cc3dff
cc3dff
Fix Description:  The previous delete operation check was in the wrong location, and the
cc3dff
                  delete operation was treated as a modify - which then triggered the
cc3dff
                  error 53.  Added the correct check for the delete operation.
cc3dff
cc3dff
                  Also removed some old code for a CLEANALLRUV attribute that was never
cc3dff
                  implemented.
cc3dff
cc3dff
https://fedorahosted.org/389/ticket/47620
cc3dff
cc3dff
Reviewed by: nhosoi(Thanks!)
cc3dff
(cherry picked from commit 9c41a365e8fbd23cab28eb91f50cdce696a30730)
cc3dff
(cherry picked from commit 77380161e9e04f64a431dd35ce4b4c45ed01cae5)
cc3dff
---
cc3dff
 ldap/servers/plugins/replication/repl5.h          |  1 -
cc3dff
 ldap/servers/plugins/replication/repl5_agmtlist.c | 46 +++++++++++------------
cc3dff
 ldap/servers/plugins/replication/repl_globals.c   |  1 -
cc3dff
 3 files changed, 22 insertions(+), 26 deletions(-)
cc3dff
cc3dff
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
cc3dff
index 321a285..655e8ba 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl5.h
cc3dff
+++ b/ldap/servers/plugins/replication/repl5.h
cc3dff
@@ -167,7 +167,6 @@ extern const char *type_nsds5ReplicaBusyWaitTime;
cc3dff
 extern const char *type_nsds5ReplicaSessionPauseTime;
cc3dff
 extern const char *type_nsds5ReplicaEnabled;
cc3dff
 extern const char *type_nsds5ReplicaStripAttrs;
cc3dff
-extern const char *type_nsds5ReplicaCleanRUVnotified;
cc3dff
 extern const char *type_replicaProtocolTimeout;
cc3dff
 extern const char *type_replicaBackoffMin;
cc3dff
 extern const char *type_replicaBackoffMax;
cc3dff
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
index 9e0291f..0edf28a 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
@@ -254,15 +254,6 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
cc3dff
                the replication plugin - handled above */
cc3dff
             if (mods[i]->mod_op & LDAP_MOD_DELETE)
cc3dff
             {
cc3dff
-                if(strcasecmp (mods[i]->mod_type, type_nsds5ReplicaCleanRUVnotified) == 0 ){
cc3dff
-                    /* allow the deletion of cleanallruv agmt attr */
cc3dff
-                    continue;
cc3dff
-                }
cc3dff
-                if(strcasecmp (mods[i]->mod_type, type_replicaProtocolTimeout) == 0){
cc3dff
-                    agmt_set_protocol_timeout(agmt, 0);
cc3dff
-                    continue;
cc3dff
-                }
cc3dff
-
cc3dff
                 slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: " 
cc3dff
                                 "deletion of %s attribute is not allowed\n", type_nsds5ReplicaInitialize);	
cc3dff
                 *returncode = LDAP_UNWILLING_TO_PERFORM;
cc3dff
@@ -505,23 +496,30 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
cc3dff
             }
cc3dff
         }
cc3dff
         else if (slapi_attr_types_equivalent(mods[i]->mod_type, type_replicaProtocolTimeout)){
cc3dff
-            long ptimeout = 0;
cc3dff
-
cc3dff
-            if (val){
cc3dff
-                ptimeout = atol(val);
cc3dff
+            if (mods[i]->mod_op & LDAP_MOD_DELETE)
cc3dff
+            {
cc3dff
+                agmt_set_protocol_timeout(agmt, 0);
cc3dff
             }
cc3dff
-            if(ptimeout <= 0){
cc3dff
-                *returncode = LDAP_UNWILLING_TO_PERFORM;
cc3dff
-                PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,
cc3dff
-                             "attribute %s value (%s) is invalid, must be a number greater than zero.\n",
cc3dff
-                             type_replicaProtocolTimeout, val ? val : "");
cc3dff
-                slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "attribute %s value (%s) is invalid, "
cc3dff
-                                "must be a number greater than zero.\n",
cc3dff
-                                type_replicaProtocolTimeout, val ? val : "");
cc3dff
-                rc = SLAPI_DSE_CALLBACK_ERROR;
cc3dff
-                break;
cc3dff
+            else
cc3dff
+            {
cc3dff
+                long ptimeout = 0;
cc3dff
+
cc3dff
+                if (val){
cc3dff
+                    ptimeout = atol(val);
cc3dff
+                }
cc3dff
+                if(ptimeout <= 0){
cc3dff
+                    *returncode = LDAP_UNWILLING_TO_PERFORM;
cc3dff
+                    PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,
cc3dff
+                                 "attribute %s value (%s) is invalid, must be a number greater than zero.\n",
cc3dff
+                                 type_replicaProtocolTimeout, val ? val : "");
cc3dff
+                    slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "attribute %s value (%s) is invalid, "
cc3dff
+                                    "must be a number greater than zero.\n",
cc3dff
+                                    type_replicaProtocolTimeout, val ? val : "");
cc3dff
+                    rc = SLAPI_DSE_CALLBACK_ERROR;
cc3dff
+                    break;
cc3dff
+                }
cc3dff
+                agmt_set_protocol_timeout(agmt, ptimeout);
cc3dff
             }
cc3dff
-            agmt_set_protocol_timeout(agmt, ptimeout);
cc3dff
         }
cc3dff
         else if (0 == windows_handle_modify_agreement(agmt, mods[i]->mod_type, e))
cc3dff
         {
cc3dff
diff --git a/ldap/servers/plugins/replication/repl_globals.c b/ldap/servers/plugins/replication/repl_globals.c
cc3dff
index 7dfeb9b..305ed25 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl_globals.c
cc3dff
+++ b/ldap/servers/plugins/replication/repl_globals.c
cc3dff
@@ -133,7 +133,6 @@ const char *type_nsds5ReplicaBusyWaitTime = "nsds5ReplicaBusyWaitTime";
cc3dff
 const char *type_nsds5ReplicaSessionPauseTime = "nsds5ReplicaSessionPauseTime";
cc3dff
 const char *type_nsds5ReplicaEnabled = "nsds5ReplicaEnabled";
cc3dff
 const char *type_nsds5ReplicaStripAttrs = "nsds5ReplicaStripAttrs";
cc3dff
-const char *type_nsds5ReplicaCleanRUVnotified = "nsds5ReplicaCleanRUVNotified";
cc3dff
 
cc3dff
 /* windows sync specific attributes */
cc3dff
 const char *type_nsds7WindowsReplicaArea = "nsds7WindowsReplicaSubtree";
cc3dff
-- 
cc3dff
1.8.1.4
cc3dff