mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
Disallow removing global and cn=config overlays for now.
Those require some special handling.
This commit is contained in:
parent
a6ab844c17
commit
21bac1cbed
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user