From 224a0dfad69c2e056f19e2b4865d592f495fb944 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 13 Feb 2009 14:17:24 -0500 Subject: Always pass teh database path explicitly, so that test cases can use throw away databases Check version and init main db if empty --- server/util/server.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'server/util/server.c') diff --git a/server/util/server.c b/server/util/server.c index be3c13cc9..35e72fa04 100644 --- a/server/util/server.c +++ b/server/util/server.c @@ -240,6 +240,7 @@ int server_setup(const char *name, int flags, struct event_context *event_ctx; struct main_context *ctx; uint16_t stdin_event_flags; + char *conf_db; int ret = EOK; debug_prg_name = strdup(name); @@ -284,7 +285,14 @@ int server_setup(const char *name, int flags, ctx->event_ctx = event_ctx; - ret = confdb_init(ctx, event_ctx, &ctx->confdb_ctx); + conf_db = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE); + if (conf_db == NULL) { + DEBUG(0,("Out of memory, aborting!\n")); + return ENOMEM; + } + DEBUG(3, ("CONFDB: %s\n", conf_db)); + + ret = confdb_init(ctx, event_ctx, &ctx->confdb_ctx, conf_db); if (ret != EOK) { DEBUG(0,("The confdb initialization failed\n")); return ret; -- cgit