From 6160200187b5b5f7ee662762b997c5c55401fe77 Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Oct 19 2010 15:29:12 +0000 Subject: 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. --- diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c index 5e3b9b5..9ee7525 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c +++ b/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 diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 92b06d7..d15310a 100644 --- a/ldap/servers/slapd/modify.c +++ b/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;