dbwrap: add a dbwrap_flags argument to db_open()
authorMichael Adam <obnox@samba.org>
Mon, 27 Jan 2014 13:49:12 +0000 (14:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2014 15:06:06 +0000 (16:06 +0100)
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 <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
34 files changed:
source3/groupdb/mapping_tdb.c
source3/lib/dbwrap/dbwrap_open.c
source3/lib/dbwrap/dbwrap_open.h
source3/lib/dbwrap/dbwrap_watch.c
source3/lib/g_lock.c
source3/lib/serverid.c
source3/lib/sharesec.c
source3/locking/brlock.c
source3/locking/share_mode_lock.c
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_xattr_tdb.c
source3/passdb/account_pol.c
source3/passdb/pdb_tdb.c
source3/passdb/secrets.c
source3/printing/printer_list.c
source3/registry/reg_backend_db.c
source3/rpc_client/cli_netlogon.c
source3/smbd/notify_internal.c
source3/smbd/smbXsrv_open.c
source3/smbd/smbXsrv_session.c
source3/smbd/smbXsrv_tcon.c
source3/smbd/smbXsrv_version.c
source3/torture/test_dbwrap_watch.c
source3/torture/test_idmap_tdb_common.c
source3/torture/torture.c
source3/utils/dbwrap_tool.c
source3/utils/dbwrap_torture.c
source3/utils/net_idmap.c
source3/utils/net_idmap_check.c
source3/utils/net_registry_check.c
source3/utils/status.c
source3/winbindd/idmap_autorid_tdb.c
source3/winbindd/idmap_tdb.c
source3/winbindd/idmap_tdb2.c

index 3cb1024..cc397d9 100644 (file)
@@ -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)));
index 515b4bf..6c9280c 100644 (file)
@@ -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
index 51c7dfd..d14794e 100644 (file)
@@ -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__ */
index b586b66..ba4381e 100644 (file)
@@ -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;
 }
index 8c7a6c2..6813f06 100644 (file)
@@ -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);
index cb49520..4259887 100644 (file)
@@ -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;
 }
 
index c7a8e51..095c851 100644 (file)
@@ -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) ));
index e1f0c15..a516b60 100644 (file)
@@ -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")));
index 20756bf..5d0874c 100644 (file)
@@ -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"));
index 80839e3..8ee4bd5 100644 (file)
@@ -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) {
index 43456cf..63a12fd 100644 (file)
@@ -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) {
index 06925e8..5f2c7ab 100644 (file)
@@ -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;
index f256e6c..162083f 100644 (file)
@@ -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));
index f97510d..9d91c2f 100644 (file)
@@ -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));
index 6e02ee5..a64775d 100644 (file)
@@ -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;
 }
 
index 3e561eb..fdaf576 100644 (file)
@@ -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",
index b7b490f..9e3c1bd 100644 (file)
@@ -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;
index 994608c..0a7e5de 100644 (file)
@@ -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;
        }
index 3e2fed3..7e6b54f 100644 (file)
@@ -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;
 
index fa3033b..560fa3c 100644 (file)
@@ -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;
 
index b6e2058..2cbd761 100644 (file)
@@ -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;
 
index 8ba5e1f..b24dae9 100644 (file)
@@ -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: "
index 9c2a679..4e699fe 100644 (file)
@@ -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;
index 6f5f3c5..f7262a2 100644 (file)
@@ -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)));
index 1d915fc..1f29a70 100644 (file)
@@ -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;
index ffca6b6..b56e07a 100644 (file)
@@ -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;
index 2741820..f748ac2 100644 (file)
@@ -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,
index 1095f14..ec2b050 100644 (file)
@@ -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));
index e75c890..4b82871 100644 (file)
@@ -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"),
index 8cdb8fa..d57c2aa 100644 (file)
@@ -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"),
index be7c52f..1ff0e36 100644 (file)
@@ -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",
index e06cb21..dd99767 100644 (file)
@@ -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));
index cc930ff..ebff347 100644 (file)
@@ -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;
index 4a9c2fe..942490d 100644 (file)
@@ -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) {