From: Luke Howard Date: Tue, 1 Apr 2003 17:38:02 +0000 (+0000) Subject: Handle the case where slapi_x_ldapmods2modifications() returns NULL; the X-Git-Tag: AUTOCONF_2_57~124 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d2b6e8d56cc6a76de26d51cbd70787338b852310;p=openldap Handle the case where slapi_x_ldapmods2modifications() returns NULL; the modify request becomes a NOOP for the front-end in this case. --- diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index cada1d417f..5677d1f1c7 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -361,6 +361,20 @@ do_modify( */ slapi_pblock_get( pb, SLAPI_MODIFY_MODS, (void **)&modv ); modlist = slapi_x_ldapmods2modifications( modv ); + + /* + * NB: it is valid for the plugin to return no modifications + * (for example, a plugin might store some attributes elsewhere + * and remove them from the modification list; if only those + * attribute types were included in the modification request, + * then slapi_x_ldapmods2modifications() above will return + * NULL). + */ + if ( modlist == NULL ) { + rs->sr_err = LDAP_SUCCESS; + send_ldap_result( op, rs ); + goto cleanup; + } #endif /* defined( LDAP_SLAPI ) */ /*