dbwrap: add dbwrap_flags argument to dbwrap_local_open()
authorMichael Adam <obnox@samba.org>
Mon, 27 Jan 2014 15:38:25 +0000 (16:38 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2014 15:06:07 +0000 (16:06 +0100)
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>
auth/credentials/credentials_secrets.c
lib/dbwrap/dbwrap.h
lib/dbwrap/dbwrap_local_open.c
libcli/auth/netlogon_creds_cli.c
libcli/auth/schannel_state_tdb.c
source3/lib/dbwrap/dbwrap_open.c
source4/cluster/local.c

index 6c1cded4cbc52ad5fbd3cd29c5f8db7427765d43..9fad104bdb8afc2c8a02a178939dc10c6b99ab31 100644 (file)
@@ -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,
                                   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
         * account here, so we don't want the 'pending' flag around
         * any more */
index 02b44052dd78e6979eb2de2707fc2cfe439f8e04..1949d5f8e5e256892a7c973ebeee9c73276ea0dc 100644 (file)
@@ -160,6 +160,7 @@ struct db_context *dbwrap_local_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_H__ */
index e54ed979f35361d880fbe8acfb2dbe389cf59393..a6f494e313d80e5b9f31d6ffa1ec04352a28287d 100644 (file)
@@ -160,7 +160,8 @@ struct db_context *dbwrap_local_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)
 {
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
        const char *ntdbname, *tdbname;
index 88893ad7d3a69fdd82cd4b0b28f073e5da26bcc8..d73335da1d62906872189e163e18e642fed383ec 100644 (file)
@@ -227,7 +227,8 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
                                      fname, 0,
                                      TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
                                      O_RDWR|O_CREAT,
-                                     0600, DBWRAP_LOCK_ORDER_2);
+                                     0600, DBWRAP_LOCK_ORDER_2,
+                                     DBWRAP_FLAG_NONE);
        if (global_db == NULL) {
                DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s - %s\n",
                         fname, strerror(errno)));
index 6669b465b731cc4cb0716a2cd7db52286490b52f..2219540b1c6a1fb25f45c707ede6ad89f2c0e497 100644 (file)
@@ -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,
                                  TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
-                                 0600, 0);
+                                 0600, 0, DBWRAP_FLAG_NONE);
 
        if (!db_sc) {
                DEBUG(0,("open_schannel_session_store: Failed to open %s - %s\n",
index 7f3cddf276f5dcdf818f66b2348f961665c3d8a4..ee5ec749831308557262cef9cdecf8a145836abb 100644 (file)
@@ -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());
                result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
                                           tdb_flags, open_flags, mode,
-                                          lock_order);
+                                          lock_order, dbwrap_flags);
                talloc_unlink(mem_ctx, lp_ctx);
        }
        return result;
index aa0fd7def4a41fd4187c28d3a91aff644a1bc5f3..0a659509023a263df3b3d175d4ac9b1521592b42 100644 (file)
@@ -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);
        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);
        return db;
 }