forked from pool/openldap2
7e3c62b9c1
OBS-URL: https://build.opensuse.org/request/show/61462 OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=64
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
From 6479c8a2980e1a430861df162011780e675fc888 Mon Sep 17 00:00:00 2001
|
|
From: Ralf Haferkamp <rhafer@suse.de>
|
|
Date: Wed, 16 Jun 2010 14:08:56 +0200
|
|
Subject: assorted fixes for back-config DELETE support
|
|
|
|
|
|
diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c
|
|
index 5f8ae10..507dd5a 100644
|
|
--- a/servers/slapd/bconfig.c
|
|
+++ b/servers/slapd/bconfig.c
|
|
@@ -5958,13 +5958,26 @@ config_back_delete( Operation *op, SlapReply *rs )
|
|
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
|
} else if ( op->o_abandon ) {
|
|
rs->sr_err = SLAPD_ABANDON;
|
|
- } else if ( ce->ce_type == Cft_Overlay ){
|
|
+ } else if ( ce->ce_type == Cft_Overlay || ce->ce_type == Cft_Database){
|
|
char *iptr;
|
|
int count, ixold;
|
|
|
|
ldap_pvt_thread_pool_pause( &connection_pool );
|
|
|
|
- overlay_remove( ce->ce_be, (slap_overinst *)ce->ce_bi );
|
|
+ if ( ce->ce_type == Cft_Overlay ){
|
|
+ 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;
|
|
+ rs->sr_text = "Cannot delete config or frontend database";
|
|
+ ldap_pvt_thread_pool_resume( &connection_pool );
|
|
+ goto out;
|
|
+ }
|
|
+ if ( ce->ce_be->bd_info->bi_db_close ) {
|
|
+ ce->ce_be->bd_info->bi_db_close( ce->ce_be, NULL );
|
|
+ }
|
|
+ backend_destroy_one( ce->ce_be, 1);
|
|
+ }
|
|
|
|
/* remove CfEntryInfo from the siblings list */
|
|
if ( ce->ce_parent->ce_kids == ce ) {
|
|
@@ -6026,6 +6039,7 @@ config_back_delete( Operation *op, SlapReply *rs )
|
|
#else
|
|
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
|
#endif /* SLAP_CONFIG_DELETE */
|
|
+out:
|
|
send_ldap_result( op, rs );
|
|
return rs->sr_err;
|
|
}
|
|
--
|
|
1.7.3.4
|
|
|