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 3cb1024829cb6adac69cdf1ef847bdf7c21769ff..cc397d964fd86ca003bf28f1f62dde058505011c 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 515b4bff1d171e2e8da59937d870aea181a45ec1..6c9280cedbb7f6813c018fed39cf9585438c3d74 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 51c7dfd23535054db2e20610c2d2da153ed5be88..d14794ea17c4400132235e08e1b0c6be650d50aa 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 b586b661a34e562193a5c110860bf6eedbe8063f..ba4381e045b0328ecc9708405814406b909731a3 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 8c7a6c203b23afb484f706b1f17a4970c6d7fc88..6813f0641f26f3925b4156ea9412d08cb3ca1a81 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 cb495205640c7af52486cd2cf536fff6d76f8011..425988794798a8d3fe9ed09802c12d59d592e324 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 c7a8e51c05a4356c58d710699a67d4ec2fffb48d..095c851825ed83ef3bf8adae980746e81c1d1e96 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 e1f0c15812768acadc13be1ebbb1cf054817f031..a516b6004b822c7938dc5008526f0ce272c387a6 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 20756bf5d7158bfa98b67dccbb85daf0bfd08aee..5d0874c3be1301e86abb10ba70371775e4af9c82 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 80839e33623de99423c2cc6084e779898472872e..8ee4bd5460f547ab88db34d47a4a88bc6566a729 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 43456cf61002316814f333b89569467a0f01f2da..63a12fd75dd8c9b38376628ca54a9ab0c30de97e 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 06925e8af666bdd90d254e66d69219fd0a123a3c..5f2c7ab2eb65e656c55f683c5c946b4638c40f75 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 f256e6c7fb323c2220d409efeed0f903e1427fc8..162083f9c705ee34240134d6bf199a48b9db49f1 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 f97510db211d21d7ab8bc3a2dc686350c8311a5e..9d91c2f3d3bcf306de8185a978068baca39ff9df 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 6e02ee5f724de8fceae27ae6d0b9faba51e177da..a64775dfd8eadc5847efa1cc7e097534cb923ea2 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 3e561eb3893c484e341a3b5fd5f80e866a4d8099..fdaf576e7bcc6273d22743b9451c82a1d97ddbd5 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 b7b490f818b29db2e9d940ce88f0fff37919b51b..9e3c1bd30e6bd411529a7aa6ba1b8300702eb0e2 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 994608c6666b7f703f64e0200145c977b444c8eb..0a7e5dea22f390e7d0a7cc1c3d823d5a7deb36a6 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 3e2fed3ac1427bf5aa058ca9533eaad4801b12a8..7e6b54fc0858d024c3860da64b5f42b0cfe13184 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 fa3033b7522259aa56d9af9416d25bf5ffc1e374..560fa3c2b4d5da110edea8b42f073c094192e690 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 b6e205857a7be8fca74e7153565ecefd4badacaa..2cbd7613677f13b458a89e39fe55c007f9c67998 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 8ba5e1fc98ec103543660ffccd6583d6e8be8904..b24dae9f12f044dc316df1e3231840111de24195 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 9c2a6799561cf838fb5f20e2e57cf14bd2695cc2..4e699fe35c440c9dbfb060825c004cef94f174e4 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 6f5f3c55f8438d4d0740daf1318abc8d159c16ad..f7262a241073e28df6731fe9c712e1de534fe148 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 1d915fc62c7810e39bf159e2c11591fddb5758e8..1f29a706774edd3ace87c8b97cbb20c2734de6db 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 ffca6b6d62a4b2980e732170d37aa9a066d14947..b56e07a037c3d78ebb0d53aaa7664af3630e98e3 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 2741820aec5d24b0e7b6139843974c1ea1f920ca..f748ac26aab7c7030069fe01ac65e670da509d56 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 1095f143d5674c8d27a1810f05c457d80b9d9806..ec2b05087ee83aa5c12cc31067ada8984fba3e48 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 e75c8906de18a10a0ebe069b3207f61929ec2c8f..4b828719ea4a601208c9e6766def58ca8dbb498e 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 8cdb8fac5912a5f1bfb9c6c6bf4d6b8550b7efa0..d57c2aac5e4d242f7da443e7808052f4c73ac100 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 be7c52fac4644c319515451762d56d7328ac3902..1ff0e36ad333d2ac6cce5399eb466190fd3b1f53 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 e06cb21a3e855fa1406ee3346e30fc1f8a43033a..dd997671c95aa4306439044e71fca0eeb99c90c4 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 cc930fffb7a40f4e6652a150aa68eb2a12d2bfa9..ebff3475d390ee896cfe1001b6b852746879d730 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 4a9c2feb8f3267d014bca6c9983b6564fc843d47..942490d58b825c1cdcea6630da090ac6c7d97d4b 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) {