* 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 );
* 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;
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 );