From: Hallvard Furuseth Date: Fri, 31 Dec 2010 08:45:48 +0000 (+0000) Subject: ITS#6758 bconfig.c: ensure sr_text==NULL if sr_err==LDAP_SUCCESS X-Git-Tag: MIGRATION_CVS2GIT~307 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab1bc728fa56983c44458ece4333ef07bd2e79af;p=openldap 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. --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index e650b02b2b..dda830388d 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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 ) {