summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-01-27 14:49:12 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-07 16:06:06 +0100
commitcf0cb0add9ed47b8974272237fee0e1a4ba7bf68 (patch)
treee655a5a44b8d134767b6a58a281aa040317a664c /source3/utils
parent229dcfd3501e4743d5d9aea5c9f7a97d7612a499 (diff)
downloadsamba-cf0cb0add9ed47b8974272237fee0e1a4ba7bf68.tar.gz
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 <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/dbwrap_tool.c2
-rw-r--r--source3/utils/dbwrap_torture.c2
-rw-r--r--source3/utils/net_idmap.c8
-rw-r--r--source3/utils/net_idmap_check.c2
-rw-r--r--source3/utils/net_registry_check.c4
-rw-r--r--source3/utils/status.c2
6 files changed, 10 insertions, 10 deletions
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",