mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 17:19:43 -05:00
refine previous commit (error out before actual add)
This commit is contained in:
parent
fa4e093f0c
commit
324174fc76
1 changed files with 15 additions and 7 deletions
|
|
@ -3626,9 +3626,19 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, i
|
|||
* These entries can have auto-assigned indexes (appended to the end)
|
||||
* but only the other types support auto-renumbering of siblings.
|
||||
*/
|
||||
rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
|
||||
if ( rc )
|
||||
goto done;
|
||||
{
|
||||
int renumber = renum ? *renum : 0;
|
||||
rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
|
||||
if ( rc ) {
|
||||
goto done;
|
||||
}
|
||||
if ( renum && *renum && renumber == -1 ) {
|
||||
snprintf( ca->msg, sizeof( ca->msg ),
|
||||
"operation requires sibling renumbering" );
|
||||
rc = LDAP_UNWILLING_TO_PERFORM;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
init_config_argv( ca );
|
||||
|
||||
|
|
@ -3746,6 +3756,8 @@ config_back_add( Operation *op, SlapReply *rs )
|
|||
* 4) store entry in underlying database
|
||||
* 5) perform any necessary renumbering
|
||||
*/
|
||||
/* NOTE: by now we do not accept adds that require renumbering */
|
||||
renumber = -1;
|
||||
rs->sr_err = config_add_internal( cfb, op->ora_e, &ca, rs, &renumber );
|
||||
if ( rs->sr_err != LDAP_SUCCESS ) {
|
||||
rs->sr_text = ca.msg;
|
||||
|
|
@ -3770,10 +3782,6 @@ config_back_add( Operation *op, SlapReply *rs )
|
|||
op->o_dn = dn;
|
||||
op->o_ndn = ndn;
|
||||
}
|
||||
if ( renumber ) {
|
||||
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
||||
rs->sr_text = "renaming not implemented yet within naming context";
|
||||
}
|
||||
|
||||
ldap_pvt_thread_pool_resume( &connection_pool );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue