]> git.sur5r.net Git - openldap/commitdiff
Disallow removing global and cn=config overlays for now.
authorRalf Haferkamp <ralf@openldap.org>
Tue, 29 Jun 2010 16:23:31 +0000 (16:23 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Tue, 29 Jun 2010 16:23:31 +0000 (16:23 +0000)
Those require some special handling.

servers/slapd/backover.c
servers/slapd/bconfig.c

index cef32866c163c33b724c1a7b3d6ae16635f33e47..8fff96cbe9fe483c8d4a2db4ec0805c6b7abf920 100644 (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);
        }
index 1db63ea574cb492ead09168e68778ec1fa0f8ed5..59236f5a7057605475335be8b03d0f98e638b77a 100644 (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;