Disallow removing global and cn=config overlays for now.

Those require some special handling.
This commit is contained in:
Ralf Haferkamp 2010-06-29 16:23:31 +00:00
parent a6ab844c17
commit 21bac1cbed
2 changed files with 13 additions and 2 deletions

View File

@ -1140,7 +1140,6 @@ overlay_remove( BackendDB *be, slap_overinst *on )
if ( ! oi->oi_list )
{
/* reset db flags and bd_info to orig */
SLAP_DBFLAGS( be ) &= ~SLAP_DBFLAG_GLOBAL_OVERLAY;
be->bd_info = oi->oi_orig;
ch_free(oi);
}

View File

@ -6120,7 +6120,19 @@ config_back_delete( Operation *op, SlapReply *rs )
ldap_pvt_thread_pool_pause( &connection_pool );
if ( ce->ce_type == Cft_Overlay ){
overlay_remove( ce->ce_be, (slap_overinst *)ce->ce_bi );
if ( SLAP_ISGLOBALOVERLAY(ce->ce_be ) ) {
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "Cannot delete global overlays";
ldap_pvt_thread_pool_resume( &connection_pool );
goto out;
} else if ( ce->ce_be == op->o_bd->bd_self ) {
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "Cannot delete cn=config overlays";
ldap_pvt_thread_pool_resume( &connection_pool );
goto out;
} else {
overlay_remove( ce->ce_be, (slap_overinst *)ce->ce_bi );
}
} else { /* Cft_Database*/
if ( ce->ce_be == frontendDB || ce->ce_be == op->o_bd ){
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;