}
}
- flags = DB_THREAD | DB_CREATE | bdb->bi_db_opflags;
+ flags = DB_THREAD | bdb->bi_db_opflags;
bdb->bi_databases = (struct bdb_db_info **) ch_malloc(
BDB_INDICES * sizeof(struct bdb_db_info *) );
bdb_bt_compare );
rc = db->bdi_db->set_pagesize( db->bdi_db,
BDB_ID2ENTRY_PAGESIZE );
+ if ( slapMode & SLAP_TOOL_READMAIN ) {
+ flags |= DB_RDONLY;
+ } else {
+ flags |= DB_CREATE;
+ }
} else {
rc = db->bdi_db->set_flags( db->bdi_db,
DB_DUP | DB_DUPSORT );
#ifndef BDB_HIER
rc = db->bdi_db->set_dup_compare( db->bdi_db,
bdb_bt_compare );
+ if ( slapMode & SLAP_TOOL_READONLY ) {
+ flags |= DB_RDONLY;
+ } else {
+ flags |= DB_CREATE;
+ }
#else
rc = db->bdi_db->set_dup_compare( db->bdi_db,
bdb_dup_compare );
rc = db->bdi_db->set_bt_compare( db->bdi_db,
bdb_bt_compare );
+ if ( slapMode & (SLAP_TOOL_READONLY|SLAP_TOOL_READMAIN) ) {
+ flags |= DB_RDONLY;
+ } else {
+ flags |= DB_CREATE;
+ }
#endif
rc = db->bdi_db->set_pagesize( db->bdi_db,
BDB_PAGESIZE );
return rc;
}
+ flags &= ~(DB_CREATE | DB_RDONLY);
db->bdi_name = bdbi_databases[i].name;
bdb->bi_databases[i] = db;
}
e->e_id = NOID;
}
bdb_entry_release( &op, e, 0 );
+ TXN_CHECKPOINT( bi->bi_dbenv,
+ bi->bi_txn_cp_kbyte, bi->bi_txn_cp_min, 0 );
return rc;
}
#define SLAP_MODE 0x0003
#define SLAP_TRUNCATE_MODE 0x0100
+#define SLAP_TOOL_READMAIN 0x0200
+#define SLAP_TOOL_READONLY 0x0400
struct slap_replica_info {
char *ri_host; /* supersedes be_replica */