summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 10:39:30 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit1e6f2180724de4722a5218826c9401181168d9d4 (patch)
treee81c1e8290adeca27722cefe5c24edc3f04f90a3
parent234958be042980242fff6da936af674da877c5ef (diff)
downloadsssd-1e6f2180724de4722a5218826c9401181168d9d4.tar.gz
sssd-1e6f2180724de4722a5218826c9401181168d9d4.tar.xz
sssd-1e6f2180724de4722a5218826c9401181168d9d4.zip
Remove the sysdb_ctx_get_domain() function.
We are deprecating sysdb->domain so kill the function that gives access to this member as we should stop relying on it being available (or correct).
-rw-r--r--src/db/sysdb.c5
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_selinux.c2
-rw-r--r--src/providers/ipa/ipa_subdomains.c5
-rw-r--r--src/tools/sss_cache.c21
5 files changed, 16 insertions, 19 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index f68c30acd..479791b79 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -293,11 +293,6 @@ struct ldb_context *sysdb_ctx_get_ldb(struct sysdb_ctx *sysdb)
return sysdb->ldb;
}
-struct sss_domain_info *sysdb_ctx_get_domain(struct sysdb_ctx *sysdb)
-{
- return sysdb->domain;
-}
-
struct sysdb_attrs *sysdb_new_attrs(TALLOC_CTX *mem_ctx)
{
return talloc_zero(mem_ctx, struct sysdb_attrs);
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 10eec5e6a..9c2996adb 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -347,8 +347,6 @@ char *sysdb_group_strdn(TALLOC_CTX *mem_ctx,
struct ldb_context *sysdb_ctx_get_ldb(struct sysdb_ctx *sysdb);
-struct sss_domain_info *sysdb_ctx_get_domain(struct sysdb_ctx *sysdb);
-
int compare_ldb_dn_comp_num(const void *m1, const void *m2);
/* functions to start and finish transactions */
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index a6b4809f6..44e870248 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -304,7 +304,7 @@ sysdb_get_selinux_usermaps(TALLOC_CTX *mem_ctx,
struct ldb_dn *basedn;
struct sss_domain_info *domain;
- domain = sysdb_ctx_get_domain(sysdb);
+ domain = sysdb->domain;
basedn = ldb_dn_new_fmt(mem_ctx, sysdb_ctx_get_ldb(sysdb),
SYSDB_TMPL_SELINUX_BASE, domain->name);
if (!basedn) {
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 0bf2e5d8e..878b8979a 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -688,14 +688,17 @@ static void ipa_subdomains_handler_done(struct tevent_req *req)
struct ipa_subdomains_req_ctx *ctx;
struct be_req *be_req;
struct sysdb_ctx *sysdb;
+ struct sss_domain_info *domain;
bool refresh_has_changes = false;
ctx = tevent_req_callback_data(req, struct ipa_subdomains_req_ctx);
be_req = ctx->be_req;
if (be_req && be_req->sysdb) {
sysdb = be_req->sysdb;
+ domain = be_req->domain;
} else {
sysdb = ctx->sd_ctx->be_ctx->sysdb;
+ domain = ctx->sd_ctx->be_ctx->domain;
}
ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply);
@@ -740,7 +743,7 @@ static void ipa_subdomains_handler_done(struct tevent_req *req)
goto done;
}
- ret = ipa_subdomains_write_mappings(sysdb_ctx_get_domain(sysdb),
+ ret = ipa_subdomains_write_mappings(domain,
ctx->sd_ctx->num_subdoms,
ctx->sd_ctx->subdoms);
if (ret != EOK) {
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index 2ab5303a4..3de122379 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -78,7 +78,9 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain);
errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx);
errno_t invalidate_entry(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
const char *name, int entry_type);
-static bool invalidate_entries(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
+static bool invalidate_entries(TALLOC_CTX *ctx,
+ struct sss_domain_info *dinfo,
+ struct sysdb_ctx *sysdb,
enum sss_cache_entry entry_type,
const char *filter, const char *name);
static errno_t update_all_filters(struct cache_tool_ctx *tctx,
@@ -115,15 +117,15 @@ int main(int argc, const char *argv[])
goto done;
}
- skipped &= !invalidate_entries(tctx, sysdb, TYPE_USER,
+ skipped &= !invalidate_entries(tctx, dinfo, sysdb, TYPE_USER,
tctx->user_filter, tctx->user_name);
- skipped &= !invalidate_entries(tctx, sysdb, TYPE_GROUP,
+ skipped &= !invalidate_entries(tctx, dinfo, sysdb, TYPE_GROUP,
tctx->group_filter, tctx->group_name);
- skipped &= !invalidate_entries(tctx, sysdb, TYPE_NETGROUP,
+ skipped &= !invalidate_entries(tctx, dinfo, sysdb, TYPE_NETGROUP,
tctx->netgroup_filter, tctx->netgroup_name);
- skipped &= !invalidate_entries(tctx, sysdb, TYPE_SERVICE,
+ skipped &= !invalidate_entries(tctx, dinfo, sysdb, TYPE_SERVICE,
tctx->service_filter, tctx->service_name);
- skipped &= !invalidate_entries(tctx, sysdb, TYPE_AUTOFSMAP,
+ skipped &= !invalidate_entries(tctx, dinfo, sysdb, TYPE_AUTOFSMAP,
tctx->autofs_filter, tctx->autofs_name);
ret = sysdb_transaction_commit(sysdb);
@@ -268,7 +270,9 @@ static errno_t update_all_filters(struct cache_tool_ctx *tctx,
return EOK;
}
-static bool invalidate_entries(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
+static bool invalidate_entries(TALLOC_CTX *ctx,
+ struct sss_domain_info *dinfo,
+ struct sysdb_ctx *sysdb,
enum sss_cache_entry entry_type,
const char *filter, const char *name)
{
@@ -280,12 +284,9 @@ static bool invalidate_entries(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
int i;
const char *c_name;
bool iret;
- struct sss_domain_info *dinfo;
if (!filter) return false;
- dinfo = sysdb_ctx_get_domain(sysdb);
-
switch (entry_type) {
case TYPE_USER:
type_string = "user";