Browse Source

Ticket #609 - nsDS5BeginReplicaRefresh attribute accepts any value and it doesn't throw any error when server restarts.

Bug description: If an invalid value is set to ds5BeginReplicaRefresh
in an agreement, it does not affect the behaviour, but it does not get
purged from the agreement and causes an error if "ds5BeginReplicaRefresh:
start" is added.

Fix description: Adding an invalid ds5BeginReplicaRefresh is rejected
with "DSA is unwilling to perform" and the following error is returned:
    ldap_modify: additional info: Invalid value (junk_value123) value
	supplied for attr (nsds5BeginReplicaRefresh); Ignoring ...

Reviewed by Rich (Thank you!!)

https://fedorahosted.org/389/ticket/609
Noriko Hosoi 12 years ago
parent
commit
b6b8d7bbda
1 changed files with 6 additions and 3 deletions
  1. 6 3
      ldap/servers/plugins/replication/repl5_agmtlist.c

+ 6 - 3
ldap/servers/plugins/replication/repl5_agmtlist.c

@@ -275,7 +275,7 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
                     break;   
                 }
 
-			    /* Start replica initialization */
+                /* Start replica initialization */
                 if (val == NULL)
                 {
                     PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "No value supplied for attr (%s)", mods[i]->mod_type);
@@ -300,9 +300,12 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
                 }
                 else
                 {
-                    PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid value (%s) value supplied for attr (%s)", 
-                             val, mods[i]->mod_type);
+                    PR_snprintf (errortext, SLAPI_DSE_RETURNTEXT_SIZE, 
+                                 "Invalid value (%s) value supplied for attr (%s); Ignoring ...", 
+                                 val, mods[i]->mod_type);
                     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "agmtlist_modify_callback: %s\n", errortext);
+                    *returncode = LDAP_UNWILLING_TO_PERFORM;
+                    rc = SLAPI_DSE_CALLBACK_ERROR;
                 }
                 slapi_ch_free ((void**)&val);
             }