db = db_open(NULL, state_path("group_mapping.tdb"), 0,
TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
DEBUG(0, ("Failed to open group mapping database: %s\n",
strerror(errno)));
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
- enum dbwrap_lock_order lock_order)
+ enum dbwrap_lock_order lock_order,
+ uint64_t dbwrap_flags)
{
struct db_context *result = NULL;
#ifdef CLUSTER_SUPPORT
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
- enum dbwrap_lock_order lock_order);
+ enum dbwrap_lock_order lock_order,
+ uint64_t dbwrap_flags);
#endif /* __DBWRAP_OPEN_H__ */
watchers_db = db_open(
NULL, lock_path("dbwrap_watchers.tdb"), 0,
TDB_CLEAR_IF_FIRST | TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_3);
+ O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_3,
+ DBWRAP_FLAG_NONE);
}
return watchers_db;
}
result->db = db_open(result, lock_path("g_lock.tdb"), 0,
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_2);
+ DBWRAP_LOCK_ORDER_2,
+ DBWRAP_FLAG_NONE);
if (result->db == NULL) {
DEBUG(1, ("g_lock_init: Could not open g_lock.tdb\n"));
TALLOC_FREE(result);
}
db = db_open(NULL, lock_path("serverid.tdb"), 0,
TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2);
+ O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_2,
+ DBWRAP_FLAG_NONE);
return db;
}
share_db = db_open(NULL, state_path("share_info.tdb"), 0,
TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (share_db == NULL) {
DEBUG(0,("Failed to open share info database %s (%s)\n",
state_path("share_info.tdb"), strerror(errno) ));
brlock_db = db_open(NULL, lock_path("brlock.tdb"),
SMB_OPEN_DATABASE_TDB_HASH_SIZE, tdb_flags,
read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644,
- DBWRAP_LOCK_ORDER_2);
+ DBWRAP_LOCK_ORDER_2, DBWRAP_FLAG_NONE);
if (!brlock_db) {
DEBUG(0,("Failed to open byte range locking database %s\n",
lock_path("brlock.tdb")));
SMB_OPEN_DATABASE_TDB_HASH_SIZE,
TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
read_only?O_RDONLY:O_RDWR|O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!lock_db) {
DEBUG(0,("ERROR: Failed to initialise locking database\n"));
become_root();
acl_db = db_open(NULL, dbname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
unbecome_root();
if (acl_db == NULL) {
become_root();
db = db_open(NULL, dbname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_2);
+ DBWRAP_LOCK_ORDER_2, DBWRAP_FLAG_NONE);
unbecome_root();
if (db == NULL) {
}
db = db_open(NULL, state_path("account_policy.tdb"), 0, TDB_DEFAULT,
- O_RDWR, 0600, DBWRAP_LOCK_ORDER_1);
+ O_RDWR, 0600, DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) { /* the account policies files does not exist or open
* failed, try to create a new one */
db = db_open(NULL, state_path("account_policy.tdb"), 0,
TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
DEBUG(0,("Failed to open account policy database\n"));
return False;
tmp_db = db_open(NULL, tmp_fname, 0,
TDB_DEFAULT, O_CREAT|O_RDWR, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (tmp_db == NULL) {
DEBUG(0, ("tdbsam_convert_backup: Failed to create backup TDB passwd "
"[%s]\n", tmp_fname));
orig_db = db_open(NULL, dbname, 0,
TDB_DEFAULT, O_CREAT|O_RDWR, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (orig_db == NULL) {
DEBUG(0, ("tdbsam_convert_backup: Failed to re-open "
"converted passdb TDB [%s]\n", dbname));
/* Try to open tdb passwd. Create a new one if necessary */
db_sam = db_open(NULL, name, 0, TDB_DEFAULT, O_CREAT|O_RDWR, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db_sam == NULL) {
DEBUG(0, ("tdbsam_open: Failed to open/create TDB passwd "
"[%s]\n", name));
db_ctx = db_open(NULL, fname, 0,
TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
DEBUG(0,("Failed to open %s\n", fname));
}
db = db_open(NULL, PL_DB_NAME(), 0,
TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_1);
+ O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
return db;
}
regdb = db_open(NULL, state_path("registry.tdb"), 0,
REG_TDB_FLAGS, O_RDWR, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!regdb) {
regdb = db_open(NULL, state_path("registry.tdb"), 0,
REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!regdb) {
werr = ntstatus_to_werror(map_nt_error_from_unix(errno));
DEBUG(1,("regdb_init: Failed to open registry %s (%s)\n",
regdb = db_open(NULL, state_path("registry.tdb"), 0,
REG_TDB_FLAGS, O_RDWR, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if ( !regdb ) {
result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",
global_db = db_open(talloc_autofree_context(), fname,
0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2);
+ O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2,
+ DBWRAP_FLAG_NONE);
if (global_db == NULL) {
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
notify->db_index = db_open(
notify, lock_path("notify_index.tdb"),
0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_3);
+ O_RDWR|O_CREAT, 0644, DBWRAP_LOCK_ORDER_3, DBWRAP_FLAG_NONE);
if (notify->db_index == NULL) {
goto fail;
}
TDB_CLEAR_IF_FIRST |
TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
NTSTATUS status;
TDB_CLEAR_IF_FIRST |
TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
NTSTATUS status;
TDB_CLEAR_IF_FIRST |
TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
NTSTATUS status;
TDB_CLEAR_IF_FIRST |
TDB_INCOMPATIBLE_HASH,
O_RDWR | O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
status = map_nt_error_from_unix_common(errno);
DEBUG(0,("smbXsrv_version_global_init: "
goto fail;
}
db = db_open(msg, "test_watch.tdb", 0, TDB_DEFAULT,
- O_CREAT|O_RDWR, 0644, DBWRAP_LOCK_ORDER_1);
+ O_CREAT|O_RDWR, 0644, DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db == NULL) {
fprintf(stderr, "db_open failed: %s\n", strerror(errno));
goto fail;
ctx->db = db_open(ctx, db_path, 0, TDB_DEFAULT,
O_RDWR | O_CREAT, 0600,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if(!ctx->db) {
DEBUG(0, ("Failed to open database: %s\n", strerror(errno)));
TDB_DATA value;
db = db_open(talloc_tos(), "transtest.tdb", 0, TDB_DEFAULT,
- O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_1);
+ O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_1,
+ DBWRAP_FLAG_NONE);
if (db == NULL) {
printf("Could not open transtest.db\n");
return false;
case OP_LISTKEYS:
case OP_EXISTS:
db = db_open(mem_ctx, dbname, 0, tdb_flags, O_RDWR | O_CREAT,
- 0644, DBWRAP_LOCK_ORDER_1);
+ 0644, DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
d_fprintf(stderr, "ERROR: could not open dbname\n");
goto done;
}
db = db_open(mem_ctx, db_name, 0, tdb_flags, O_RDWR | O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
d_fprintf(stderr, "failed to open db '%s': %s\n", db_name,
if (readonly) {
*db = db_open(mem_ctx, dbfile, 0, TDB_DEFAULT, O_RDONLY, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (*db == NULL) {
d_fprintf(stderr,
_("Could not open autorid db (%s): %s\n"),
d_fprintf(stderr, _("dumping id mapping from %s\n"), dbfile);
db = db_open(mem_ctx, dbfile, 0, TDB_DEFAULT, O_RDONLY, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
d_fprintf(stderr, _("Could not open idmap db (%s): %s\n"),
dbfile, strerror(errno));
}
db = db_open(mem_ctx, dbfile, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
d_fprintf(stderr, _("Could not open idmap db (%s): %s\n"),
dbfile, strerror(errno));
d_fprintf(stderr, _("deleting id mapping from %s\n"), dbfile);
db = db_open(mem_ctx, dbfile, 0, TDB_DEFAULT, O_RDWR, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (db == NULL) {
d_fprintf(stderr, _("Could not open idmap db (%s): %s\n"),
dbfile, strerror(errno));
}
ctx->db = db_open(ctx, name, 0, TDB_DEFAULT, oflags, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (ctx->db == NULL) {
d_fprintf(stderr,
_("Could not open idmap db (%s) for writing: %s\n"),
}
ctx->odb = db_open(ctx, ctx->opt.output, 0, TDB_DEFAULT, oflags, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (ctx->odb == NULL) {
d_fprintf(stderr,
_("Could not open db (%s) for writing: %s\n"),
static bool check_ctx_open_input(struct check_ctx *ctx) {
ctx->idb = db_open(ctx, ctx->fname, 0, TDB_DEFAULT, O_RDONLY, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (ctx->idb == NULL) {
d_fprintf(stderr,
_("Could not open db (%s) for reading: %s\n"),
struct db_context *db;
db = db_open(NULL, lock_path("locking.tdb"), 0,
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDONLY, 0,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!db) {
d_printf("%s not initialised\n",
/* Open idmap repository */
*db = db_open(mem_ctx, path, 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (*db == NULL) {
DEBUG(0, ("Unable to open idmap_autorid database '%s'\n", path));
/* Open idmap repository */
db = db_open(mem_ctx, tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
if (!db) {
DEBUG(0, ("Unable to open idmap database\n"));
ret = NT_STATUS_UNSUCCESSFUL;
/* Open idmap repository */
ctx->db = db_open(ctx, db_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644,
- DBWRAP_LOCK_ORDER_1);
+ DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
TALLOC_FREE(db_path);
if (ctx->db == NULL) {