op->o_callback = ≻
op->orr_newrdn = *newrdn;
op->orr_nnewrdn = *nnewrdn;
+ op->orr_newSup = NULL;
+ op->orr_nnewSup = NULL;
op->orr_deleteoldrdn = 1;
op->orr_modlist = NULL;
slap_modrdn2mods( op, rs );
if ( ce->ce_type == ce_type ) nsibs++;
}
+ /* account for -1 frontend */
+ if ( ce_type == Cft_Database )
+ nsibs--;
+
if ( index != nsibs ) {
if ( gotindex ) {
if ( index < nsibs ) {
renumber = 1;
}
}
- if ( !isfrontend && index == -1 )
+ if ( !isfrontend && index == -1 ) {
index = nsibs;
+ }
/* just make index = nsibs */
if ( !renumber ) {
return LDAP_SUCCESS;
}
+static void
+schema_destroy_one( ConfigArgs *ca, ConfigOCs **colst, int nocs,
+ CfEntryInfo *p )
+{
+ ConfigTable *ct;
+ ConfigFile *cfo;
+ AttributeDescription *ad;
+ const char *text;
+
+ ca->valx = -1;
+ ca->line = NULL;
+ if ( cfn->c_cr_head ) {
+ struct berval bv = BER_BVC("olcDitContentRules");
+ ad = NULL;
+ slap_bv2ad( &bv, &ad, &text );
+ ct = config_find_table( colst, nocs, ad );
+ config_del_vals( ct, ca );
+ }
+ if ( cfn->c_oc_head ) {
+ struct berval bv = BER_BVC("olcObjectClasses");
+ ad = NULL;
+ slap_bv2ad( &bv, &ad, &text );
+ ct = config_find_table( colst, nocs, ad );
+ config_del_vals( ct, ca );
+ }
+ if ( cfn->c_at_head ) {
+ struct berval bv = BER_BVC("olcAttributeTypes");
+ ad = NULL;
+ slap_bv2ad( &bv, &ad, &text );
+ ct = config_find_table( colst, nocs, ad );
+ config_del_vals( ct, ca );
+ }
+ if ( cfn->c_om_head ) {
+ struct berval bv = BER_BVC("olcObjectIdentifier");
+ ad = NULL;
+ slap_bv2ad( &bv, &ad, &text );
+ ct = config_find_table( colst, nocs, ad );
+ config_del_vals( ct, ca );
+ }
+ cfo = p->ce_private;
+ cfo->c_kids = cfn->c_sibs;
+ ch_free( cfn );
+}
+
/* Parse an LDAP entry into config directives */
static int
config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs,
}
if ( rc != LDAP_SUCCESS )
- goto done;
+ goto done_noop;
/* Parse all the values and check for simple syntax errors before
* performing any set actions.
rc = check_name_index( last, colst[0]->co_type, e, rs, renum,
&ibase );
if ( rc ) {
- goto done;
+ goto done_noop;
}
if ( renum && *renum && colst[0]->co_type != Cft_Database &&
colst[0]->co_type != Cft_Overlay ) {
snprintf( ca->msg, sizeof( ca->msg ),
"operation requires sibling renumbering" );
rc = LDAP_UNWILLING_TO_PERFORM;
- goto done;
+ goto done_noop;
}
}
ct = config_find_table( colst, nocs, a->a_desc );
if ( !ct ) continue; /* user data? */
rc = check_vals( ct, ca, a, 1 );
- if ( rc ) goto done;
+ if ( rc ) goto done_noop;
}
/* Basic syntax checks are OK. Do the actual settings. */
backend_destroy_one( ca->be, 1 );
} else if ( (colst[0]->co_type == Cft_Overlay) && ca->bi ) {
overlay_destroy_one( ca->be, (slap_overinst *)ca->bi );
+ } else if ( colst[0]->co_type == Cft_Schema ) {
+ schema_destroy_one( ca, colst, nocs, last );
}
}
+done_noop:
ch_free( ca->argv );
if ( colst ) ch_free( colst );
ca->valx = d->idx[i];
rc = config_del_vals( ct, ca );
if ( rc != LDAP_SUCCESS ) break;
- s->a_flags |= SLAP_ATTR_IXDEL;
+ if ( s )
+ s->a_flags |= SLAP_ATTR_IXDEL;
for (j=i+1; j < d->nidx; j++)
if ( d->idx[j] >d->idx[i] )
d->idx[j]--;
ca->line = NULL;
rc = config_del_vals( ct, ca );
if ( rc ) rc = LDAP_OTHER;
- s->a_flags |= SLAP_ATTR_IXDEL;
+ if ( s )
+ s->a_flags |= SLAP_ATTR_IXDEL;
}
if ( ml->sml_values ) {
d = d->next;
ce->ce_parent = parent;
if ( parent ) {
pdn = parent->ce_entry->e_nname;
- if ( parent->ce_kids && parent->ce_kids->ce_type < ce->ce_type )
+ if ( parent->ce_kids )
for ( ceprev = parent->ce_kids; ceprev->ce_sibs &&
- ceprev->ce_type < ce->ce_type;
+ ceprev->ce_type <= ce->ce_type;
ceprev = ceprev->ce_sibs );
} else {
BER_BVZERO( &pdn );