summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-01-23 12:57:33 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-02-29 12:53:47 -0500
commitd2d2d6ae0c436461bcc8f881df059eb036314c44 (patch)
tree679d929d1b5aa4106413179d99e86c60c200279c /src/tools
parentb97595ae059c69b1960a6e7e56d74660388a683b (diff)
downloadsssd-d2d2d6ae0c436461bcc8f881df059eb036314c44.tar.gz
sssd-d2d2d6ae0c436461bcc8f881df059eb036314c44.tar.xz
sssd-d2d2d6ae0c436461bcc8f881df059eb036314c44.zip
Keep sysdb context in domain info struct
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/sss_cache.c10
-rw-r--r--src/tools/tools_util.c10
2 files changed, 4 insertions, 16 deletions
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index e8b1926ba..a9885b07f 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -204,14 +204,8 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain) {
}
if (domain) {
- ret = confdb_get_domain(ctx->confdb, domain, &ctx->domains);
- if (ret != EOK) {
- DEBUG(1, ("Could not get '%s' domain: [%d] [%s]\n",
- domain, ret, strerror(ret)));
- goto fail;
- }
-
- ret = sysdb_domain_init(ctx, ctx->domains, DB_PATH, &db_ctx);
+ ret = sysdb_init_domain_and_sysdb(ctx, ctx->confdb, domain, DB_PATH,
+ &ctx->domains, &db_ctx);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
goto fail;
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 004489533..871ba2b11 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -53,14 +53,8 @@ static int setup_db(struct tools_ctx *ctx)
return ret;
}
- ret = confdb_get_domain(ctx->confdb, "local", &ctx->local);
- if (ret != EOK) {
- DEBUG(1, ("Could not get 'local' domain: [%d] [%s]\n", ret, strerror(ret)));
- return ret;
- }
-
- /* open 'local' sysdb at default path */
- ret = sysdb_domain_init(ctx, ctx->local, DB_PATH, &ctx->sysdb);
+ ret = sysdb_init_domain_and_sysdb(ctx, ctx->confdb, "local", DB_PATH,
+ &ctx->local, &ctx->sysdb);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
return ret;