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