From: Pierangelo Masarati Date: Tue, 25 Apr 2006 19:51:38 +0000 (+0000) Subject: allow empty modlist X-Git-Tag: OPENLDAP_REL_ENG_2_4_1ALPHA~2^2~148 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=54f7d5aef3d5a8a753cf0a219750393d00b9160c;p=openldap allow empty modlist --- diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 3cd9bcb78a..a8a5f56c32 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -509,7 +509,8 @@ static int apply_modify_to_entry(Entry * entry, SlapReply * rs) { char textbuf[SLAP_TEXT_BUFLEN]; - int rc = LDAP_UNWILLING_TO_PERFORM; + int rc = modlist ? LDAP_UNWILLING_TO_PERFORM : LDAP_SUCCESS; + int is_oc = 0; Modification *mods = NULL; if (!acl_check_modlist(op, entry, modlist)) { @@ -519,6 +520,9 @@ static int apply_modify_to_entry(Entry * entry, for (; modlist != NULL; modlist = modlist->sml_next) { mods = &modlist->sml_mod; + if ( mods->sm_desc == slap_schema.si_ad_objectClass ) { + is_oc = 1; + } switch (mods->sm_op) { case LDAP_MOD_ADD: rc = modify_add_values(entry, mods, @@ -568,13 +572,14 @@ static int apply_modify_to_entry(Entry * entry, } if(rc == LDAP_SUCCESS) { - if ( mods->sm_desc == slap_schema.si_ad_objectClass ) { + if ( is_oc ) { entry->e_ocflags = 0; } /* check that the entry still obeys the schema */ - rc = entry_schema_check(op, entry, NULL, 0, + rc = entry_schema_check( op, entry, NULL, 0, &rs->sr_text, textbuf, sizeof( textbuf ) ); } + return rc; }