浏览代码

Bug 305131 - Allow empty modify operation

This patch allows an empty modify operation.  We currently reject
an empty modify operation, but this patch makes the empty operation
update the modifyTimestamp and modifiersName attributes similar to
a touch-type operation.
Nathan Kinder 15 年之前
父节点
当前提交
6160200187
共有 2 个文件被更改,包括 1 次插入21 次删除
  1. 1 3
      ldap/servers/slapd/back-ldbm/ldbm_modify.c
  2. 0 18
      ldap/servers/slapd/modify.c

+ 1 - 3
ldap/servers/slapd/back-ldbm/ldbm_modify.c

@@ -623,9 +623,7 @@ mods_have_effect (Slapi_Entry *entry, Slapi_Mods *smods)
 
 	if ( entry && entry->e_sdn.dn ) {
 		for ( j = 0; j < smods->num_mods - 1; j++ ) {
-			if ( ((mod = smods->mods[j]) != NULL) &&
-				 strcasecmp (mod->mod_type, "modifiersname") &&
-				 strcasecmp (mod->mod_type, "modifytime") ) {
+			if ((mod = smods->mods[j]) != NULL) {
 				for ( attr = entry->e_attrs; attr; attr = attr->a_next ) {
 					/* Mods have effect if at least a null-value-mod is
 					 * to actually remove an existing attribute

+ 0 - 18
ldap/servers/slapd/modify.c

@@ -341,24 +341,6 @@ do_modify( Slapi_PBlock *pb )
 		goto free_and_return;
 	}
 
-	/* see if there were actually any mods to perform */
-	if ( slapi_mods_get_num_mods (&smods) == 0 )
-	{
-		int		lderr;
-		char	*emsg;
-
-		if ( ignored_some_mods ) {
-			lderr = LDAP_UNWILLING_TO_PERFORM;
-			emsg = "no modifiable attributes specified";
-		} else {
-			lderr = LDAP_PROTOCOL_ERROR;
-			emsg = "no modifications specified";
-		}
-		op_shared_log_error_access (pb, "MOD", dn, emsg);
-		send_ldap_result( pb, lderr, NULL, emsg, 0, NULL );
-		goto free_and_return;
-	}
-
 #ifdef LDAP_DEBUG
 	LDAPDebug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
 	for (mod = slapi_mods_get_first_mod(&smods); mod != NULL;