From cf0cb0add9ed47b8974272237fee0e1a4ba7bf68 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 27 Jan 2014 14:49:12 +0100 Subject: 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 Reviewed-by: Stefan Metzmacher --- source3/utils/dbwrap_tool.c | 2 +- source3/utils/dbwrap_torture.c | 2 +- source3/utils/net_idmap.c | 8 ++++---- source3/utils/net_idmap_check.c | 2 +- source3/utils/net_registry_check.c | 4 ++-- source3/utils/status.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/utils') 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", -- cgit v1.2.1