ldap/servers/plugins/replication/repl5.h | 1
ldap/servers/plugins/replication/repl5_agmt.c | 24 ++++++++++++++++++++++
ldap/servers/plugins/replication/repl5_agmtlist.c | 9 ++++++++
3 files changed, 34 insertions(+)
New commits:
commit e86013506df7f3da280d67be2b3bd9ab24b241bf
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Aug 1 15:45:21 2012 -0400
Ticket 413 - "Server is unwilling to perform" when running ldapmodify on
nsds5ReplicaStripAttrs
Bug Description: trying to set nsds5ReplicaStripAttrs yields an error 53
Fix Description: Needed to check for this new attribute when in the agmtlist modify
callback. When it doesn't recognize the attribute it returns
error 53.
https://fedorahosted.org/389/ticket/413
Reviewed by: Richm(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5.h
b/ldap/servers/plugins/replication/repl5.h
index b04d9c4..d7ba6a6 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -358,6 +358,7 @@ int agmt_has_protocol(Repl_Agmt *agmt);
PRBool agmt_is_enabled(Repl_Agmt *ra);
int agmt_set_enabled_from_entry(Repl_Agmt *ra, Slapi_Entry *e);
char **agmt_get_attrs_to_strip(Repl_Agmt *ra);
+int agmt_set_attrs_to_strip(Repl_Agmt *ra, Slapi_Entry *e);
typedef struct replica Replica;
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c
b/ldap/servers/plugins/replication/repl5_agmt.c
index 4beb13a..2978aba 100644
--- a/ldap/servers/plugins/replication/repl5_agmt.c
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
@@ -2547,3 +2547,27 @@ agmt_get_attrs_to_strip(Repl_Agmt *ra)
return NULL;
}
}
+
+int
+agmt_set_attrs_to_strip(Repl_Agmt *ra, Slapi_Entry *e)
+{
+ char *tmpstr = NULL;
+
+ PR_Lock(ra->lock);
+
+ tmpstr = slapi_entry_attr_get_charptr(e, type_nsds5ReplicaStripAttrs);
+ if (NULL != tmpstr){
+ if(ra->attrs_to_strip){
+ slapi_ch_array_free(&ra->attrs_to_strip);
+ }
+ ra->attrs_to_strip = slapi_str2charray_ext(tmpstr, " ", 0);
+ PR_Unlock(ra->lock);
+ prot_notify_agmt_changed(ra->protocol, ra->long_name);
+ slapi_ch_free_string(&tmpstr);
+ return 0;
+ }
+
+ PR_Unlock(ra->lock);
+
+ return -1;
+}
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c
b/ldap/servers/plugins/replication/repl5_agmtlist.c
index 1c18a85..86f06bf 100644
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
@@ -499,6 +499,15 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore,
Slapi_Entry
rc = SLAPI_DSE_CALLBACK_ERROR;
}
}
+ else if (slapi_attr_types_equivalent(mods[i]->mod_type,
type_nsds5ReplicaStripAttrs))
+ {
+ if(agmt_set_attrs_to_strip(agmt, e) != 0){
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"agmtlist_modify_callback: "
+ "failed to set replica agmt attributes to strip for
%s\n",agmt_get_long_name(agmt));
+ *returncode = LDAP_OPERATIONS_ERROR;
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ }
+ }
else if (0 == windows_handle_modify_agreement(agmt, mods[i]->mod_type, e))
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"agmtlist_modify_callback: "