X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fslapi%2Fslapi_ops.c;h=3e32409ecf40e4adf29a0995d9fdf769ab298acf;hb=173330187ef1a4139e2e4c4fb30ad23832e40f77;hp=4b7b02ae794062f38ff52befd7fb55285d8b8226;hpb=916e931065b53404eace714c12565c3e9983b5c3;p=openldap diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 4b7b02ae79..3e32409ecf 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2002-2004 The OpenLDAP Foundation. + * Copyright 2002-2005 The OpenLDAP Foundation. * Portions Copyright 1997,2002-2003 IBM Corporation. * All rights reserved. * @@ -450,16 +450,24 @@ slapi_int_ldapmod_to_entry( } else { int repl_user = be_isupdate_dn( op->o_bd, &op->o_bd->be_rootdn ); if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) { - int update = op->o_bd->be_update_ndn.bv_len; - char textbuf[SLAP_TEXT_BUFLEN]; - size_t textlen = sizeof textbuf; + int update = !BER_BVISNULL( &op->o_bd->be_update_ndn ); + char textbuf[ SLAP_TEXT_BUFLEN ]; + size_t textlen = sizeof( textbuf ); - rc = slap_mods_check( modlist, update, &text, + rc = slap_mods_check( modlist, &text, textbuf, textlen, NULL ); if ( rc != LDAP_SUCCESS) { goto cleanup; } + if ( !update ) { + rc = slap_mods_no_update_check( modlist, + &text, textbuf, textlen ); + if ( rc != LDAP_SUCCESS) { + goto cleanup; + } + } + if ( !repl_user ) { rc = slap_mods_opattrs( op, modlist, modtail, &text, @@ -995,6 +1003,7 @@ slapi_modify_internal( /* fall through */ case LDAP_MOD_DELETE: case LDAP_MOD_REPLACE: + case LDAP_MOD_INCREMENT: break; default: @@ -1014,18 +1023,26 @@ slapi_modify_internal( if ( op->o_bd->be_modify ) { int repl_user = be_isupdate( op ); if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) { - int update = op->o_bd->be_update_ndn.bv_len; - const char *text = NULL; - char textbuf[SLAP_TEXT_BUFLEN]; - size_t textlen = sizeof( textbuf ); - slap_callback cb = { NULL, slap_replog_cb, NULL, NULL }; + int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn ); + const char *text = NULL; + char textbuf[ SLAP_TEXT_BUFLEN ]; + size_t textlen = sizeof( textbuf ); + slap_callback cb = { NULL, slap_replog_cb, NULL, NULL }; - rs.sr_err = slap_mods_check( modlist, update, + rs.sr_err = slap_mods_check( modlist, &text, textbuf, textlen, NULL ); if ( rs.sr_err != LDAP_SUCCESS ) { goto cleanup; } + if ( !update ) { + rs.sr_err = slap_mods_no_update_check( modlist, + &text, textbuf, textlen ); + if ( rs.sr_err != LDAP_SUCCESS ) { + goto cleanup; + } + } + if ( !repl_user ) { rs.sr_err = slap_mods_opattrs( op, modlist, modtail, &text, textbuf,