mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
dbwrap: add dbwrap_flags argument to dbwrap_local_open()
To be consistent with db_open() and prepare for future possible extensions. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
e4fbaadb5c
commit
7e766a0a8a
@ -255,7 +255,8 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr
|
||||
|
||||
db_ctx = dbwrap_local_open(cred, lp_ctx, secrets_tdb, 0,
|
||||
TDB_DEFAULT, O_RDWR, 0600,
|
||||
DBWRAP_LOCK_ORDER_1);
|
||||
DBWRAP_LOCK_ORDER_1,
|
||||
DBWRAP_FLAG_NONE);
|
||||
/* Bleh, nasty recursion issues: We are setting a machine
|
||||
* account here, so we don't want the 'pending' flag around
|
||||
* any more */
|
||||
|
@ -160,6 +160,7 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
||||
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_H__ */
|
||||
|
@ -160,7 +160,8 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
||||
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)
|
||||
{
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||
const char *ntdbname, *tdbname;
|
||||
|
@ -227,7 +227,8 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
|
||||
fname, 0,
|
||||
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
|
||||
O_RDWR|O_CREAT,
|
||||
0600, DBWRAP_LOCK_ORDER_2);
|
||||
0600, DBWRAP_LOCK_ORDER_2,
|
||||
DBWRAP_FLAG_NONE);
|
||||
if (global_db == NULL) {
|
||||
DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s - %s\n",
|
||||
fname, strerror(errno)));
|
||||
|
@ -49,7 +49,7 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,
|
||||
|
||||
db_sc = dbwrap_local_open(mem_ctx, lp_ctx, fname, 0,
|
||||
TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
|
||||
0600, 0);
|
||||
0600, 0, DBWRAP_FLAG_NONE);
|
||||
|
||||
if (!db_sc) {
|
||||
DEBUG(0,("open_schannel_session_store: Failed to open %s - %s\n",
|
||||
|
@ -147,7 +147,7 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
|
||||
struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
|
||||
result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
|
||||
tdb_flags, open_flags, mode,
|
||||
lock_order);
|
||||
lock_order, dbwrap_flags);
|
||||
talloc_unlink(mem_ctx, lp_ctx);
|
||||
}
|
||||
return result;
|
||||
|
@ -63,7 +63,7 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
|
||||
|
||||
path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
|
||||
db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
|
||||
0600, 0);
|
||||
0600, 0, DBWRAP_FLAG_NONE);
|
||||
talloc_free(tmp_ctx);
|
||||
return db;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user