1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

dbwrap: add a dbwrap_flags argument to db_open_ntdb()

for consistency and to perpare for possible future
flags that the ntdb backend might be aware of.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Michael Adam 2014-01-28 12:37:36 +01:00 committed by Stefan Metzmacher
parent bbf0903d6b
commit e4fbaadb5c
3 changed files with 7 additions and 4 deletions

View File

@ -111,7 +111,7 @@ static bool tdb_to_ntdb(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx,
}
ntdb = db_open_ntdb(ctx, lp_ctx, ntdbname, dbwrap_hash_size(tdb),
TDB_DEFAULT, O_RDWR|O_CREAT|O_EXCL,
st.st_mode & 0777, 0);
st.st_mode & 0777, 0, DBWRAP_FLAG_NONE);
if (!ntdb) {
DEBUG(0, ("tdb_to_ntdb: could not create %s: %s\n",
ntdbname, strerror(errno)));
@ -204,7 +204,8 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
}
}
db = db_open_ntdb(mem_ctx, lp_ctx, ntdbname, hash_size,
ntdb_flags, open_flags, mode, lock_order);
ntdb_flags, open_flags, mode, lock_order,
dbwrap_flags);
} else {
if (!streq(ntdbname, tdbname) && file_exist(ntdbname)) {
DEBUG(0, ("Refusing to open '%s' when '%s' exists\n",

View File

@ -502,7 +502,8 @@ struct db_context *db_open_ntdb(TALLOC_CTX *mem_ctx,
const char *ntdbname,
int hash_size, int ntdb_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;
struct db_ntdb_ctx *db_ntdb;

View File

@ -30,6 +30,7 @@ struct db_context *db_open_ntdb(TALLOC_CTX *mem_ctx,
const char *name,
int hash_size, int ntdb_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_NTDB_H__ */