struct berval bdb_uuid = { 0, NULL };
+typedef void * db_malloc(size_t);
+typedef void * db_realloc(void *, size_t);
+
static int
bdb_open( BackendInfo *bi )
{
return rc;
}
+ bdb->bi_dbenv->set_alloc( bdb->bi_dbenv, (db_malloc *)ber_memalloc,
+ (db_realloc *)ber_memrealloc, ber_memfree );
+
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 );