ITS#6758 bconfig.c: ensure sr_text==NULL if sr_err==LDAP_SUCCESS

config_modify_internal(): Do not send rs->sr_text with success.
config_back_modify(): When slap_bv2ad() can set rs->sr_text,
set sr->sr_err too and catch failure.
This commit is contained in:
Hallvard Furuseth 2010-12-31 08:45:48 +00:00
parent 089cf2d421
commit ab1bc728fa

View File

@ -5825,6 +5825,7 @@ out:
out_noop:
if ( rc == LDAP_SUCCESS ) {
attrs_free( save_attrs );
rs->sr_text = NULL;
} else {
attrs_free( e->e_attrs );
e->e_attrs = save_attrs;
@ -5871,7 +5872,10 @@ config_back_modify( Operation *op, SlapReply *rs )
rdn = ce->ce_entry->e_nname;
ptr = strchr( rdn.bv_val, '=' );
rdn.bv_len = ptr - rdn.bv_val;
slap_bv2ad( &rdn, &rad, &rs->sr_text );
rs->sr_err = slap_bv2ad( &rdn, &rad, &rs->sr_text );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto out;
}
/* Some basic validation... */
for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {