open_flags = rw ? (O_RDWR|O_CREAT) : O_RDONLY;
db_ctx = db_open(NULL, lock_path("connections.tdb"), 0,
- TDB_CLEAR_IF_FIRST|TDB_DEFAULT, open_flags, 0644);
+ TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_DEFAULT, open_flags, 0644);
return db_ctx;
}
result->msg = msg;
result->db = db_open(result, lock_path("g_lock.tdb"), 0,
- TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0700);
+ TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0700);
if (result->db == NULL) {
DEBUG(1, ("g_lock_init: Could not open g_lock.tdb"));
TALLOC_FREE(result);
DEBUG(5, ("Opening cache file at %s\n", cache_fname));
again:
- cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT, open_flags, 0644);
+ cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, open_flags, 0644);
if (cache) {
int ret;
ret = tdb_check(cache, NULL, NULL);
first_try = false;
DEBUG(0, ("gencache_init: tdb_check(%s) failed - retry after CLEAR_IF_FIRST\n",
cache_fname));
- cache = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST, open_flags, 0644);
+ cache = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, open_flags, 0644);
if (cache) {
tdb_close(cache);
cache = NULL;
if (!cache && (errno == EACCES)) {
open_flags = O_RDONLY;
- cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT, open_flags,
+ cache = tdb_open_log(cache_fname, 0, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, open_flags,
0644);
if (cache) {
DEBUG(5, ("gencache_init: Opening cache file %s read-only.\n", cache_fname));
DEBUG(5, ("Opening cache file at %s\n", cache_fname));
- cache_notrans = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST,
+ cache_notrans = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
open_flags, 0644);
if (cache_notrans == NULL) {
DEBUG(5, ("Opening %s failed: %s\n", cache_fname,
ctx->msg_ctx = msg_ctx;
ctx->tdb = tdb_wrap_open(ctx, lock_path("messages.tdb"), 0,
- TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE,
+ TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT,0600);
if (!ctx->tdb) {
*/
db = tdb_wrap_open(mem_ctx, lock_path("messages.tdb"), 0,
- TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE,
+ TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT,0600);
if (db == NULL) {
DEBUG(1, ("could not open messaging.tdb: %s\n",
*/
db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
- 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT,
+ 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT,
0644);
if (db == NULL) {
DEBUG(1, ("could not open serverid.tdb: %s\n",
return db;
}
db = db_open(NULL, lock_path("serverid.tdb"), 0,
- TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0644);
+ TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644);
return db;
}
}
session_db_ctx_ptr = db_open(NULL, lock_path("sessionid.tdb"), 0,
- TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
+ TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0644);
return session_db_ctx_ptr;
}
path = cache_path(NETSAMLOGON_TDB);
again:
- tdb = tdb_open_log(path, 0, TDB_DEFAULT,
+ tdb = tdb_open_log(path, 0, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600);
if (tdb == NULL) {
DEBUG(0,("tdb_open_log('%s') - failed\n", path));
first_try = false;
DEBUG(0,("retry after CLEAR_IF_FIRST for '%s'\n", path));
- tdb = tdb_open_log(path, 0, TDB_CLEAR_IF_FIRST,
+ tdb = tdb_open_log(path, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600);
if (tdb) {
tdb_close(tdb);
memset(smb_db, '\0', sizeof(struct smbdb_ctx));
smb_db->smb_tdb = tdb_open(db_path,
- 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST,
+ 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT,
0644);
if (!tdbd) {
tdbd = tdb_wrap_open(talloc_autofree_context(),
lock_path("unexpected.tdb"), 0,
- TDB_CLEAR_IF_FIRST|TDB_DEFAULT,
+ TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0644);
if (!tdbd) {
DEBUG(0,("Failed to open unexpected.tdb\n"));
return;
}
- tdb_flags = TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST;
+ tdb_flags = TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH;
if (!lp_clustering()) {
/*
lock_db = db_open(NULL, lock_path("locking.tdb"),
lp_open_files_db_hash_size(),
- TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST,
+ TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
read_only?O_RDONLY:O_RDWR|O_CREAT, 0644);
if (!lock_db) {
}
/* Open the wins.tdb. */
- wins_tdb = tdb_open_log(state_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_CREAT|O_RDWR, 0600);
+ wins_tdb = tdb_open_log(state_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
+ O_CREAT|O_RDWR, 0600);
if (!wins_tdb) {
DEBUG(0,("initialise_wins: failed to open wins.tdb. Error was %s\n",
strerror(errno) ));
return db;
}
db = db_open(talloc_autofree_context(), PL_DB_NAME(), 0,
- TDB_DEFAULT|TDB_CLEAR_IF_FIRST,
+ TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0644);
return db;
}
}
notify->db_recursive = db_open(notify, lock_path("notify.tdb"),
- 0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST,
+ 0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0644);
if (notify->db_recursive == NULL) {
talloc_free(notify);
}
notify->db_onelevel = db_open(notify, lock_path("notify_onelevel.tdb"),
- 0, TDB_CLEAR_IF_FIRST,
+ 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0644);
if (notify->db_onelevel == NULL) {
talloc_free(notify);
*/
db1 = tdb_wrap_open(mem_ctx, lock_path("notify.tdb"),
- 0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST,
+ 0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0644);
if (db1 == NULL) {
DEBUG(1, ("could not open notify.tdb: %s\n", strerror(errno)));
return false;
}
db2 = tdb_wrap_open(mem_ctx, lock_path("notify_onelevel.tdb"),
- 0, TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0644);
+ 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644);
if (db2 == NULL) {
DEBUG(1, ("could not open notify_onelevel.tdb: %s\n",
strerror(errno)));
}
if (no_trans) {
- tdb_flags |= TDB_CLEAR_IF_FIRST;
+ tdb_flags |= TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH;
}
db = db_open(mem_ctx, db_name, 0, tdb_flags, O_RDWR | O_CREAT, 0644);
tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
- TDB_DEFAULT /* TDB_CLEAR_IF_FIRST */, O_RDWR|O_CREAT, 0600);
+ TDB_DEFAULT|TDB_INCOMPATIBLE_HASH /* TDB_CLEAR_IF_FIRST */,
+ O_RDWR|O_CREAT, 0600);
if (!tdb) {
fprintf(stderr, "Cannot open the tdb %s for writing.\n",
int result;
struct db_context *db;
db = db_open(NULL, lock_path("locking.tdb"), 0,
- TDB_CLEAR_IF_FIRST, O_RDONLY, 0);
+ TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDONLY, 0);
if (!db) {
d_printf("%s not initialised\n",
/* when working offline we must not clear the cache on restart */
wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
- lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
+ TDB_INCOMPATIBLE_HASH |
+ (lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST)),
O_RDWR|O_CREAT, 0600);
if (wcache->tdb == NULL) {
/* when working offline we must not clear the cache on restart */
wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
- lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST),
+ TDB_INCOMPATIBLE_HASH |
+ (lp_winbind_offline_logon() ? TDB_DEFAULT : (TDB_DEFAULT | TDB_CLEAR_IF_FIRST)),
O_RDWR|O_CREAT, 0600);
if (!wcache->tdb) {
tdb = tdb_open_log(tdb_path,
WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
+ TDB_INCOMPATIBLE_HASH |
( lp_winbind_offline_logon()
? TDB_DEFAULT
: TDB_DEFAULT | TDB_CLEAR_IF_FIRST ),