mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
don't error out if replacing a non-existant attribute, create opattrs in
config_build_entry() to have them also when started with -f (ITS#5343)
This commit is contained in:
parent
1af03ee2c7
commit
713ec710ad
@ -4705,7 +4705,6 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
|
|||||||
rc = modify_delete_vindex(e, &ml->sml_mod,
|
rc = modify_delete_vindex(e, &ml->sml_mod,
|
||||||
get_permissiveModify(op),
|
get_permissiveModify(op),
|
||||||
&rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg), idx );
|
&rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg), idx );
|
||||||
if ( rc ) goto out_noop;
|
|
||||||
if ( ml->sml_op == LDAP_MOD_REPLACE ) {
|
if ( ml->sml_op == LDAP_MOD_REPLACE ) {
|
||||||
ml->sml_values = vals;
|
ml->sml_values = vals;
|
||||||
ml->sml_nvalues = nvals;
|
ml->sml_nvalues = nvals;
|
||||||
@ -4776,8 +4775,9 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
|
|||||||
/* check that the entry still obeys the schema */
|
/* check that the entry still obeys the schema */
|
||||||
rc = entry_schema_check(op, e, NULL, 0, 0,
|
rc = entry_schema_check(op, e, NULL, 0, 0,
|
||||||
&rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg) );
|
&rs->sr_text, ca->cr_msg, sizeof(ca->cr_msg) );
|
||||||
if ( rc ) goto out_noop;
|
|
||||||
}
|
}
|
||||||
|
if ( rc ) goto out_noop;
|
||||||
|
|
||||||
/* Basic syntax checks are OK. Do the actual settings. */
|
/* Basic syntax checks are OK. Do the actual settings. */
|
||||||
for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
|
for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
|
||||||
ct = config_find_table( colst, nocs, ml->sml_desc, ca );
|
ct = config_find_table( colst, nocs, ml->sml_desc, ca );
|
||||||
@ -5415,13 +5415,16 @@ config_build_entry( Operation *op, SlapReply *rs, CfEntryInfo *parent,
|
|||||||
rc = structural_class(oc_at->a_vals, &oc, NULL, &text, c->cr_msg,
|
rc = structural_class(oc_at->a_vals, &oc, NULL, &text, c->cr_msg,
|
||||||
sizeof(c->cr_msg), op ? op->o_tmpmemctx : NULL );
|
sizeof(c->cr_msg), op ? op->o_tmpmemctx : NULL );
|
||||||
attr_merge_normalize_one(e, slap_schema.si_ad_structuralObjectClass, &oc->soc_cname, NULL );
|
attr_merge_normalize_one(e, slap_schema.si_ad_structuralObjectClass, &oc->soc_cname, NULL );
|
||||||
if ( op && !op->o_noop ) {
|
if ( op ) {
|
||||||
op->ora_e = e;
|
op->ora_e = e;
|
||||||
op->ora_modlist = NULL;
|
op->ora_modlist = NULL;
|
||||||
op->o_bd->be_add( op, rs );
|
slap_add_opattrs( op, NULL, NULL, 0, 0 );
|
||||||
if ( ( rs->sr_err != LDAP_SUCCESS )
|
if ( !op->o_noop ) {
|
||||||
&& (rs->sr_err != LDAP_ALREADY_EXISTS) ) {
|
op->o_bd->be_add( op, rs );
|
||||||
return NULL;
|
if ( ( rs->sr_err != LDAP_SUCCESS )
|
||||||
|
&& (rs->sr_err != LDAP_ALREADY_EXISTS) ) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( ceprev ) {
|
if ( ceprev ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user