From e514685144a5a2d1831761ab5e908466950c7d4b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 13 Jul 2002 00:18:15 +0000 Subject: [PATCH] Tweak: For slap tools, don't set DB_RECOVERY flag when opening DB environment. This allows slapcat to run while slapd is running, otherwise causes db corruption. --- servers/slapd/back-bdb/init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 5fe8baa358..2a80970a46 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -197,7 +197,12 @@ bdb_db_open( BackendDB *be ) } flags = DB_INIT_MPOOL | DB_THREAD | DB_CREATE - | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN | DB_RECOVER; + | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN; + + /* Only slapd will do recovery, slap-tools won't. Otherwise + * running slapcat while slapd is active corrupts the db. + */ + if( !(slapMode & SLAP_TOOL_MODE) ) flags |= DB_RECOVER; bdb->bi_dbenv->set_errpfx( bdb->bi_dbenv, be->be_suffix[0].bv_val ); bdb->bi_dbenv->set_errcall( bdb->bi_dbenv, bdb_errcall ); -- 2.39.5