2011-07-28 14:07:12 +02:00
|
|
|
From 1b23710affd68704d8fb66ba42901fa7aed1a379 Mon Sep 17 00:00:00 2001
|
2010-08-27 21:45:34 +02:00
|
|
|
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
|
2011-07-28 14:07:12 +02:00
|
|
|
index 006647b..3354c09 100644
|
2010-08-27 21:45:34 +02:00
|
|
|
--- a/servers/slapd/bconfig.c
|
|
|
|
+++ b/servers/slapd/bconfig.c
|
2011-07-28 14:07:12 +02:00
|
|
|
@@ -6050,13 +6050,26 @@ config_back_delete( Operation *op, SlapReply *rs )
|
2008-09-13 06:27:04 +02:00
|
|
|
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
2009-08-06 18:21:51 +02:00
|
|
|
} else if ( op->o_abandon ) {
|
|
|
|
rs->sr_err = SLAPD_ABANDON;
|
2008-09-13 06:27:04 +02:00
|
|
|
- } else if ( ce->ce_type == Cft_Overlay ){
|
2009-08-06 18:21:51 +02:00
|
|
|
+ } else if ( ce->ce_type == Cft_Overlay || ce->ce_type == Cft_Database){
|
2008-09-13 06:27:04 +02:00
|
|
|
char *iptr;
|
2009-03-24 19:56:33 +01:00
|
|
|
int count, ixold;
|
2008-09-13 06:27:04 +02:00
|
|
|
|
|
|
|
ldap_pvt_thread_pool_pause( &connection_pool );
|
2009-03-24 19:56:33 +01:00
|
|
|
|
2008-09-13 06:27:04 +02:00
|
|
|
- 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;
|
2009-08-06 18:21:51 +02:00
|
|
|
+ }
|
2008-09-13 06:27:04 +02:00
|
|
|
+ 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 ) {
|
2011-07-28 14:07:12 +02:00
|
|
|
@@ -6118,6 +6131,7 @@ config_back_delete( Operation *op, SlapReply *rs )
|
2008-09-13 06:27:04 +02:00
|
|
|
#else
|
|
|
|
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
|
|
|
|
#endif /* SLAP_CONFIG_DELETE */
|
|
|
|
+out:
|
|
|
|
send_ldap_result( op, rs );
|
|
|
|
return rs->sr_err;
|
|
|
|
}
|
2010-08-27 21:45:34 +02:00
|
|
|
--
|
2011-02-16 14:51:13 +01:00
|
|
|
1.7.3.4
|
2010-08-27 21:45:34 +02:00
|
|
|
|