Initialize ConfigArgs before calling config_del_vals (ITS#6363)

This commit is contained in:
Ralf Haferkamp 2009-11-05 15:38:03 +00:00
parent 48048c5348
commit 9d0c7b24c6

View File

@ -4578,11 +4578,13 @@ schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
ca->valx = -1; ca->valx = -1;
ca->line = NULL; ca->line = NULL;
ca->argc = 1;
if ( cfn->c_cr_head ) { if ( cfn->c_cr_head ) {
struct berval bv = BER_BVC("olcDitContentRules"); struct berval bv = BER_BVC("olcDitContentRules");
ad = NULL; ad = NULL;
slap_bv2ad( &bv, &ad, &text ); slap_bv2ad( &bv, &ad, &text );
ct = config_find_table( colst, nocs, ad, ca ); ct = config_find_table( colst, nocs, ad, ca );
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
if ( cfn->c_oc_head ) { if ( cfn->c_oc_head ) {
@ -4590,6 +4592,7 @@ schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
ad = NULL; ad = NULL;
slap_bv2ad( &bv, &ad, &text ); slap_bv2ad( &bv, &ad, &text );
ct = config_find_table( colst, nocs, ad, ca ); ct = config_find_table( colst, nocs, ad, ca );
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
if ( cfn->c_at_head ) { if ( cfn->c_at_head ) {
@ -4597,6 +4600,7 @@ schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
ad = NULL; ad = NULL;
slap_bv2ad( &bv, &ad, &text ); slap_bv2ad( &bv, &ad, &text );
ct = config_find_table( colst, nocs, ad, ca ); ct = config_find_table( colst, nocs, ad, ca );
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
if ( cfn->c_syn_head ) { if ( cfn->c_syn_head ) {
@ -4604,6 +4608,7 @@ schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
ad = NULL; ad = NULL;
slap_bv2ad( &bv, &ad, &text ); slap_bv2ad( &bv, &ad, &text );
ct = config_find_table( colst, nocs, ad, ca ); ct = config_find_table( colst, nocs, ad, ca );
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
if ( cfn->c_om_head ) { if ( cfn->c_om_head ) {
@ -4611,6 +4616,7 @@ schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
ad = NULL; ad = NULL;
slap_bv2ad( &bv, &ad, &text ); slap_bv2ad( &bv, &ad, &text );
ct = config_find_table( colst, nocs, ad, ca ); ct = config_find_table( colst, nocs, ad, ca );
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
cfo = p->ce_private; cfo = p->ce_private;
@ -5393,6 +5399,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
} }
ca->line = bv.bv_val; ca->line = bv.bv_val;
ca->valx = d->idx[i]; ca->valx = d->idx[i];
config_parse_vals(ct, ca, d->idx[i] );
rc = config_del_vals( ct, ca ); rc = config_del_vals( ct, ca );
if ( rc != LDAP_SUCCESS ) break; if ( rc != LDAP_SUCCESS ) break;
if ( s ) if ( s )
@ -5404,6 +5411,8 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
} else { } else {
ca->valx = -1; ca->valx = -1;
ca->line = NULL; ca->line = NULL;
ca->argc = 1;
ca->argv[0] = ct->ad->ad_cname.bv_val;
rc = config_del_vals( ct, ca ); rc = config_del_vals( ct, ca );
if ( rc ) rc = LDAP_OTHER; if ( rc ) rc = LDAP_OTHER;
if ( s ) if ( s )
@ -5450,6 +5459,8 @@ out:
a->a_flags &= ~(SLAP_ATTR_IXDEL|SLAP_ATTR_IXADD); a->a_flags &= ~(SLAP_ATTR_IXDEL|SLAP_ATTR_IXADD);
ca->valx = -1; ca->valx = -1;
ca->line = NULL; ca->line = NULL;
ca->argc = 1;
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
} }
for ( i=0; !BER_BVISNULL( &s->a_vals[i] ); i++ ) { for ( i=0; !BER_BVISNULL( &s->a_vals[i] ); i++ ) {
@ -5464,6 +5475,8 @@ out:
ct = config_find_table( colst, nocs, a->a_desc, ca ); ct = config_find_table( colst, nocs, a->a_desc, ca );
ca->valx = -1; ca->valx = -1;
ca->line = NULL; ca->line = NULL;
ca->argc = 1;
ca->argv[0] = ct->ad->ad_cname.bv_val;
config_del_vals( ct, ca ); config_del_vals( ct, ca );
s = attr_find( save_attrs, a->a_desc ); s = attr_find( save_attrs, a->a_desc );
if ( s ) { if ( s ) {