فهرست منبع

Ticket #621 - modify operations without values do not get replicated

Description: This was introduced by the fix for ticket 561 where in the
_cl5WriteMod the mods were checked if the values need to be encrypted
and only mods with values were written to the changelog

reviewed by Mark, Thanks

(cherry picked from commit 5a5ff2640d6e66c925550498211743a8f78a8477)
Ludwig Krispenz 12 سال پیش
والد
کامیت
439ed95bfc
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      ldap/servers/plugins/replication/cl5_api.c

+ 5 - 1
ldap/servers/plugins/replication/cl5_api.c

@@ -2537,11 +2537,15 @@ _cl5WriteMod (LDAPMod *mod, char **buff)
 	memcpy (pos, &count, sizeof (count));
 	pos += sizeof (PRInt32);
 
+	/* if the mod has no values, eg delete attr or replace attr without values 
+	 * do not reset buffer
+	 */
+	rc = 0; 
+
 	bv = slapi_mod_get_first_value (&smod);
 	while (bv)
 	{
 		encbv = NULL;
-		rc = 0;
 		rc = clcrypt_encrypt_value(s_cl5Desc.clcrypt_handle, 
 		                           bv, &encbv);
 		if (rc > 0) {