dbwrap: add a dbwrap_flags argument to db_open_ntdb()
authorMichael Adam <obnox@samba.org>
Tue, 28 Jan 2014 11:37:36 +0000 (12:37 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2014 15:06:07 +0000 (16:06 +0100)
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>
lib/dbwrap/dbwrap_local_open.c
lib/dbwrap/dbwrap_ntdb.c
lib/dbwrap/dbwrap_ntdb.h

index 650bcb35df2437f8c0b87f927c5f8d32b046bd5d..e54ed979f35361d880fbe8acfb2dbe389cf59393 100644 (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",
index 48fe39e05864a79e7395b2f942fa8183d0541245..5be5414eb9ca7d9760848111356f5e3cd38a7109 100644 (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;
index b00a5670a2a0b9472040b7c4a197860172627b40..a1da1bc0e4c75218c0123e641b08f9b1295fd085 100644 (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__ */