summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-08 14:02:53 -0500
committerSimo Sorce <simo@redhat.com>2013-01-11 10:43:15 -0500
commite55fa623db624764446cad7eb3c94b5b6a5a63d9 (patch)
tree2132b6ebfb56bda23c58f53dd76ed234e1fac26d
parent0dfef555fb1000aa932996221f045d310dbdaabd (diff)
downloadsssd-simo.tar.gz
sssd-simo.tar.xz
sssd-simo.zip
Stop creating fake sysdb contextssimo
Now that the sysdb context does not contain anymore domain related data we can simply stop creating faxe sysdb context and just reference the parent context.
-rw-r--r--src/db/sysdb.h5
-rw-r--r--src/db/sysdb_subdomains.c20
-rw-r--r--src/util/domain_info_utils.c9
3 files changed, 2 insertions, 32 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 25304289f..6dd833bfe 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -373,11 +373,6 @@ errno_t sysdb_update_subdomains(struct sysdb_ctx *sysdb,
int num_subdoms,
struct sysdb_subdom *subdoms);
-errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- struct sss_domain_info *subdomain,
- struct sysdb_ctx **subdomain_ctx);
-
errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
struct sss_domain_info *domain,
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 698065179..9b295d7e5 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -547,23 +547,3 @@ done:
talloc_free(tmp_ctx);
return ret;
}
-
-errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- struct sss_domain_info *subdomain,
- struct sysdb_ctx **subdomain_ctx)
-{
- struct sysdb_ctx *new_ctx;
-
- new_ctx = talloc_zero(mem_ctx, struct sysdb_ctx);
- if (new_ctx == NULL) {
- return ENOMEM;
- }
-
- new_ctx->ldb = sysdb->ldb;
- new_ctx->ldb_file = sysdb->ldb_file;
-
- *subdomain_ctx = new_ctx;
-
- return EOK;
-}
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index b10736fb8..ea9445e94 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -28,8 +28,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
const char *flat_name,
const char *id)
{
- int ret;
- struct sss_domain_info *dom = NULL;
+ struct sss_domain_info *dom;
dom = talloc_zero(mem_ctx, struct sss_domain_info);
if (dom == NULL) {
@@ -94,11 +93,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
DEBUG(SSSDBG_OP_FAILURE, ("Missing sysdb context in parent domain.\n"));
goto fail;
}
- ret = sysdb_get_subdomain_context(dom, parent->sysdb, dom, &dom->sysdb);
- if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_subdomain_context failed.\n"));
- goto fail;
- }
+ dom->sysdb = parent->sysdb;
return dom;