mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +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,
|
db_ctx = dbwrap_local_open(cred, lp_ctx, secrets_tdb, 0,
|
||||||
TDB_DEFAULT, O_RDWR, 0600,
|
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
|
/* Bleh, nasty recursion issues: We are setting a machine
|
||||||
* account here, so we don't want the 'pending' flag around
|
* account here, so we don't want the 'pending' flag around
|
||||||
* any more */
|
* any more */
|
||||||
|
@ -160,6 +160,7 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
|||||||
const char *name,
|
const char *name,
|
||||||
int hash_size, int tdb_flags,
|
int hash_size, int tdb_flags,
|
||||||
int open_flags, mode_t mode,
|
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__ */
|
#endif /* __DBWRAP_H__ */
|
||||||
|
@ -160,7 +160,8 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
|
|||||||
const char *name,
|
const char *name,
|
||||||
int hash_size, int tdb_flags,
|
int hash_size, int tdb_flags,
|
||||||
int open_flags, mode_t mode,
|
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);
|
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||||
const char *ntdbname, *tdbname;
|
const char *ntdbname, *tdbname;
|
||||||
|
@ -227,7 +227,8 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
|
|||||||
fname, 0,
|
fname, 0,
|
||||||
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
|
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
|
||||||
O_RDWR|O_CREAT,
|
O_RDWR|O_CREAT,
|
||||||
0600, DBWRAP_LOCK_ORDER_2);
|
0600, DBWRAP_LOCK_ORDER_2,
|
||||||
|
DBWRAP_FLAG_NONE);
|
||||||
if (global_db == NULL) {
|
if (global_db == NULL) {
|
||||||
DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s - %s\n",
|
DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s - %s\n",
|
||||||
fname, strerror(errno)));
|
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,
|
db_sc = dbwrap_local_open(mem_ctx, lp_ctx, fname, 0,
|
||||||
TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
|
TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
|
||||||
0600, 0);
|
0600, 0, DBWRAP_FLAG_NONE);
|
||||||
|
|
||||||
if (!db_sc) {
|
if (!db_sc) {
|
||||||
DEBUG(0,("open_schannel_session_store: Failed to open %s - %s\n",
|
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());
|
struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
|
||||||
result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
|
result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
|
||||||
tdb_flags, open_flags, mode,
|
tdb_flags, open_flags, mode,
|
||||||
lock_order);
|
lock_order, dbwrap_flags);
|
||||||
talloc_unlink(mem_ctx, lp_ctx);
|
talloc_unlink(mem_ctx, lp_ctx);
|
||||||
}
|
}
|
||||||
return result;
|
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);
|
path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
|
||||||
db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
|
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);
|
talloc_free(tmp_ctx);
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user