From c22c50c2fb9bc962fd11a2c9924481485faae093 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 Jan 2009 15:59:53 -0500 Subject: Regroup database rleated functions under db and rename everything with the sysdb suffix. --- server/providers/data_provider.c | 53 ---------------------------------------- 1 file changed, 53 deletions(-) (limited to 'server/providers/data_provider.c') diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index ee449a525..e0de4dbbe 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -30,8 +30,6 @@ #include #include #include "popt.h" -#include "ldb.h" -#include "ldb_errors.h" #include "util/util.h" #include "confdb/confdb.h" #include "dbus/dbus.h" @@ -47,7 +45,6 @@ struct dp_frontend; struct dp_ctx { struct event_context *ev; struct confdb_ctx *cdb; - struct ldb_context *ldb; struct service_sbus_ctx *ss_ctx; struct sbus_srv_ctx *sbus_srv; struct dp_backend *be_list; @@ -165,50 +162,6 @@ static int dp_monitor_init(struct dp_ctx *dpctx) return EOK; } -static int dp_db_init(struct dp_ctx *dpctx) -{ - TALLOC_CTX *ctx; - char *ldb_file; - char *default_db_file; - int ret; - - ctx = talloc_new(dpctx); - if(ctx == NULL) { - return ENOMEM; - } - - default_db_file = talloc_asprintf(ctx, "%s/%s", DB_PATH, DATA_PROVIDER_DB_FILE); - if (default_db_file == NULL) { - talloc_free(ctx); - return ENOMEM; - } - - ret = confdb_get_string(dpctx->cdb, ctx, - DATA_PROVIDER_DB_CONF_SEC, "ldbFile", - default_db_file, &ldb_file); - if (ret != EOK) { - talloc_free(ctx); - return ret; - } - - dpctx->ldb = ldb_init(ctx, dpctx->ev); - if (!dpctx->ldb) { - talloc_free(ctx); - return EIO; - } - - ret = ldb_connect(dpctx->ldb, ldb_file, 0, NULL); - if (ret != LDB_SUCCESS) { - talloc_free(ctx); - return EIO; - } - - talloc_steal(dpctx,dpctx->ldb); - talloc_free(ctx); - - return EOK; -} - static void be_identity_check(DBusPendingCall *pending, void *data); static void be_online_check(DBusPendingCall *pending, void *data); static void be_got_account_info(DBusPendingCall *pending, void *data); @@ -831,12 +784,6 @@ static int dp_process_init(TALLOC_CTX *mem_ctx, dpctx->ev = ev; dpctx->cdb = cdb; - ret = dp_db_init(dpctx); - if (ret != EOK) { - DEBUG(0, ("fatal error opening database\n")); - return ret; - } - ret = dp_monitor_init(dpctx); if (ret != EOK) { DEBUG(0, ("fatal error setting up monitor bus\n")); -- cgit