From: Ralf Haferkamp Date: Tue, 29 Jun 2010 16:23:31 +0000 (+0000) Subject: Disallow removing global and cn=config overlays for now. X-Git-Tag: MIGRATION_CVS2GIT~560 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21bac1cbeda54fcff41c128cc07775a63692b64a;p=openldap Disallow removing global and cn=config overlays for now. Those require some special handling. --- diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index cef32866c1..8fff96cbe9 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -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); } diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 1db63ea574..59236f5a70 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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;