From cf0cb0add9ed47b8974272237fee0e1a4ba7bf68 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 27 Jan 2014 14:49:12 +0100 Subject: dbwrap: add a dbwrap_flags argument to db_open() This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher --- source3/groupdb/mapping_tdb.c | 2 +- source3/lib/dbwrap/dbwrap_open.c | 3 ++- source3/lib/dbwrap/dbwrap_open.h | 3 ++- source3/lib/dbwrap/dbwrap_watch.c | 3 ++- source3/lib/g_lock.c | 3 ++- source3/lib/serverid.c | 3 ++- source3/lib/sharesec.c | 2 +- source3/locking/brlock.c | 2 +- source3/locking/share_mode_lock.c | 2 +- source3/modules/vfs_acl_tdb.c | 2 +- source3/modules/vfs_xattr_tdb.c | 2 +- source3/passdb/account_pol.c | 4 ++-- source3/passdb/pdb_tdb.c | 6 +++--- source3/passdb/secrets.c | 2 +- source3/printing/printer_list.c | 3 ++- source3/registry/reg_backend_db.c | 6 +++--- source3/rpc_client/cli_netlogon.c | 3 ++- source3/smbd/notify_internal.c | 2 +- source3/smbd/smbXsrv_open.c | 3 ++- source3/smbd/smbXsrv_session.c | 3 ++- source3/smbd/smbXsrv_tcon.c | 3 ++- source3/smbd/smbXsrv_version.c | 3 ++- source3/torture/test_dbwrap_watch.c | 3 ++- source3/torture/test_idmap_tdb_common.c | 2 +- source3/torture/torture.c | 3 ++- source3/utils/dbwrap_tool.c | 2 +- source3/utils/dbwrap_torture.c | 2 +- source3/utils/net_idmap.c | 8 ++++---- source3/utils/net_idmap_check.c | 2 +- source3/utils/net_registry_check.c | 4 ++-- source3/utils/status.c | 2 +- source3/winbindd/idmap_autorid_tdb.c | 2 +- source3/winbindd/idmap_tdb.c | 2 +- source3/winbindd/idmap_tdb2.c | 2 +- 34 files changed, 56 insertions(+), 43 deletions(-) diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 3cb1024829c..cc397d964fd 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -54,7 +54,7 @@ static bool init_group_mapping(void) 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))); diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index 515b4bff1d1..6c9280cedbb 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -60,7 +60,8 @@ struct db_context *db_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) { struct db_context *result = NULL; #ifdef CLUSTER_SUPPORT diff --git a/source3/lib/dbwrap/dbwrap_open.h b/source3/lib/dbwrap/dbwrap_open.h index 51c7dfd2353..d14794ea17c 100644 --- a/source3/lib/dbwrap/dbwrap_open.h +++ b/source3/lib/dbwrap/dbwrap_open.h @@ -39,6 +39,7 @@ struct db_context *db_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_OPEN_H__ */ diff --git a/source3/lib/dbwrap/dbwrap_watch.c b/source3/lib/dbwrap/dbwrap_watch.c index b586b661a34..ba4381e045b 100644 --- a/source3/lib/dbwrap/dbwrap_watch.c +++ b/source3/lib/dbwrap/dbwrap_watch.c @@ -33,7 +33,8 @@ static struct db_context *dbwrap_record_watchers_db(void) 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; } diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index 8c7a6c203b2..6813f0641f2 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -61,7 +61,8 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx, 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); diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index cb495205640..42598879479 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -77,7 +77,8 @@ static struct db_context *serverid_db(void) } 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; } diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index c7a8e51c05a..095c851825e 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -149,7 +149,7 @@ bool share_info_db_init(void) 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) )); diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index e1f0c158127..a516b6004b8 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -328,7 +328,7 @@ void brl_init(bool read_only) 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"))); diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 20756bf5d71..5d0874c3be1 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -67,7 +67,7 @@ static bool locking_init_internal(bool read_only) 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")); diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 80839e33623..8ee4bd5460f 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -60,7 +60,7 @@ static bool acl_tdb_init(void) 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) { diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index 43456cf6100..63a12fd75dd 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -320,7 +320,7 @@ static bool xattr_tdb_init(int snum, TALLOC_CTX *mem_ctx, struct db_context **p_ 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) { diff --git a/source3/passdb/account_pol.c b/source3/passdb/account_pol.c index 06925e8af66..5f2c7ab2eb6 100644 --- a/source3/passdb/account_pol.c +++ b/source3/passdb/account_pol.c @@ -220,13 +220,13 @@ bool init_account_policy(void) } 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; diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index f256e6c7fb3..162083f9c70 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -226,7 +226,7 @@ static bool tdbsam_convert_backup(const char *dbname, struct db_context **pp_db) 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)); @@ -293,7 +293,7 @@ static bool tdbsam_convert_backup(const char *dbname, struct db_context **pp_db) 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)); @@ -444,7 +444,7 @@ static bool tdbsam_open( const char *name ) /* 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)); diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index f97510db211..9d91c2f3d3b 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -79,7 +79,7 @@ bool secrets_init_path(const char *private_dir, bool use_ntdb) 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)); diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c index 6e02ee5f724..a64775dfd8e 100644 --- a/source3/printing/printer_list.c +++ b/source3/printing/printer_list.c @@ -40,7 +40,8 @@ static struct db_context *get_printer_list_db(void) } 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; } diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 3e561eb3893..fdaf576e7bc 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -732,11 +732,11 @@ WERROR regdb_init(void) 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", @@ -852,7 +852,7 @@ WERROR regdb_open( void ) 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", diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index b7b490f818b..9e3c1bd30e6 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -69,7 +69,8 @@ NTSTATUS rpccli_pre_open_netlogon_creds(void) 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; diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 994608c6666..0a7e5dea22f 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -145,7 +145,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, 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; } diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index 3e2fed3ac14..7e6b54fc085 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -64,7 +64,8 @@ NTSTATUS smbXsrv_open_global_init(void) 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; diff --git a/source3/smbd/smbXsrv_session.c b/source3/smbd/smbXsrv_session.c index fa3033b7522..560fa3c2b4d 100644 --- a/source3/smbd/smbXsrv_session.c +++ b/source3/smbd/smbXsrv_session.c @@ -73,7 +73,8 @@ NTSTATUS smbXsrv_session_global_init(void) 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; diff --git a/source3/smbd/smbXsrv_tcon.c b/source3/smbd/smbXsrv_tcon.c index b6e205857a7..2cbd7613677 100644 --- a/source3/smbd/smbXsrv_tcon.c +++ b/source3/smbd/smbXsrv_tcon.c @@ -62,7 +62,8 @@ NTSTATUS smbXsrv_tcon_global_init(void) 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; diff --git a/source3/smbd/smbXsrv_version.c b/source3/smbd/smbXsrv_version.c index 8ba5e1fc98e..b24dae9f12f 100644 --- a/source3/smbd/smbXsrv_version.c +++ b/source3/smbd/smbXsrv_version.c @@ -80,7 +80,8 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id) 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: " diff --git a/source3/torture/test_dbwrap_watch.c b/source3/torture/test_dbwrap_watch.c index 9c2a6799561..4e699fe35c4 100644 --- a/source3/torture/test_dbwrap_watch.c +++ b/source3/torture/test_dbwrap_watch.c @@ -48,7 +48,8 @@ bool run_dbwrap_watch1(int dummy) 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; diff --git a/source3/torture/test_idmap_tdb_common.c b/source3/torture/test_idmap_tdb_common.c index 6f5f3c55f84..f7262a24107 100644 --- a/source3/torture/test_idmap_tdb_common.c +++ b/source3/torture/test_idmap_tdb_common.c @@ -86,7 +86,7 @@ static bool open_db(struct idmap_tdb_common_context *ctx) 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))); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 1d915fc62c7..1f29a706774 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -9066,7 +9066,8 @@ static bool run_local_dbtrans(int dummy) 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; diff --git a/source3/utils/dbwrap_tool.c b/source3/utils/dbwrap_tool.c index ffca6b6d62a..b56e07a037c 100644 --- a/source3/utils/dbwrap_tool.c +++ b/source3/utils/dbwrap_tool.c @@ -588,7 +588,7 @@ int main(int argc, const char **argv) 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; diff --git a/source3/utils/dbwrap_torture.c b/source3/utils/dbwrap_torture.c index 2741820aec5..f748ac26aab 100644 --- a/source3/utils/dbwrap_torture.c +++ b/source3/utils/dbwrap_torture.c @@ -309,7 +309,7 @@ int main(int argc, const char *argv[]) } 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, diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 1095f143d56..ec2b05087ee 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -206,7 +206,7 @@ static bool net_idmap_opendb_autorid(TALLOC_CTX *mem_ctx, 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"), @@ -261,7 +261,7 @@ static int net_idmap_dump(struct net_context *c, int argc, const char **argv) 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)); @@ -387,7 +387,7 @@ static int net_idmap_restore(struct net_context *c, int argc, const char **argv) } 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)); @@ -598,7 +598,7 @@ static int net_idmap_delete_mapping(struct net_context *c, int argc, 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)); diff --git a/source3/utils/net_idmap_check.c b/source3/utils/net_idmap_check.c index e75c8906de1..4b828719ea4 100644 --- a/source3/utils/net_idmap_check.c +++ b/source3/utils/net_idmap_check.c @@ -790,7 +790,7 @@ static bool check_open_db(struct check_ctx* ctx, const char* name, int oflags) } 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"), diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c index 8cdb8fac591..d57c2aac5e4 100644 --- a/source3/utils/net_registry_check.c +++ b/source3/utils/net_registry_check.c @@ -338,7 +338,7 @@ static bool check_ctx_open_output(struct check_ctx *ctx) } 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"), @@ -351,7 +351,7 @@ static bool check_ctx_open_output(struct check_ctx *ctx) 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"), diff --git a/source3/utils/status.c b/source3/utils/status.c index be7c52fac46..1ff0e36ad33 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -508,7 +508,7 @@ static void print_notify_recs(const char *path, 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", diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c index e06cb21a3e8..dd997671c95 100644 --- a/source3/winbindd/idmap_autorid_tdb.c +++ b/source3/winbindd/idmap_autorid_tdb.c @@ -666,7 +666,7 @@ NTSTATUS idmap_autorid_db_init(const char *path, /* 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)); diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index cc930fffb7a..ebff3475d39 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -321,7 +321,7 @@ static NTSTATUS idmap_tdb_open_db(struct idmap_domain *dom) /* 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; diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 4a9c2feb8f3..942490d58b8 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -114,7 +114,7 @@ static NTSTATUS idmap_tdb2_open_db(struct idmap_domain *dom) /* 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) { -- cgit