summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMichal Židek <mzidek@redhat.com>2015-09-09 14:37:48 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-10-23 10:32:23 +0200
commit877b92e80bde510d5cd9f03dbf01e2bcf73ab072 (patch)
treed865b106f7d1cf9296650b4e4e4f677d56a26f89 /src/tools
parent10c07e188323a2f9824b5e34379f3b1a9b37759e (diff)
downloadsssd-877b92e80bde510d5cd9f03dbf01e2bcf73ab072.tar.gz
sssd-877b92e80bde510d5cd9f03dbf01e2bcf73ab072.tar.xz
sssd-877b92e80bde510d5cd9f03dbf01e2bcf73ab072.zip
util: Update get_next_domain's interface
Update get next domain to be able to include disbled domains and change the interface to accept flags instead of multiple booleans. Ticket: https://fedorahosted.org/sssd/ticket/2673 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/common/sss_tools.c6
-rw-r--r--src/tools/sss_cache.c5
-rw-r--r--src/tools/sss_debuglevel.c4
-rw-r--r--src/tools/sss_override.c4
4 files changed, 11 insertions, 8 deletions
diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools.c
index 0ada62e3e..c0b525555 100644
--- a/src/tools/common/sss_tools.c
+++ b/src/tools/common/sss_tools.c
@@ -134,7 +134,8 @@ static errno_t sss_tool_domains_init(TALLOC_CTX *mem_ctx,
return ret;
}
- for (dom = domains; dom != NULL; dom = get_next_domain(dom, true)) {
+ for (dom = domains; dom != NULL;
+ dom = get_next_domain(dom, SSS_GND_DESCEND)) {
if (!IS_SUBDOMAIN(dom)) {
/* Update list of subdomains for this domain */
ret = sysdb_update_subdomains(dom);
@@ -146,7 +147,8 @@ static errno_t sss_tool_domains_init(TALLOC_CTX *mem_ctx,
}
}
- for (dom = domains; dom != NULL; dom = get_next_domain(dom, true)) {
+ for (dom = domains; dom != NULL;
+ dom = get_next_domain(dom, SSS_GND_DESCEND)) {
ret = sss_names_init(mem_ctx, confdb, dom->name, &dom->names);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "sss_names_init() failed\n");
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index c9bf24914..88895e8de 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -128,7 +128,8 @@ int main(int argc, const char *argv[])
goto done;
}
- for (dinfo = tctx->domains; dinfo; dinfo = get_next_domain(dinfo, true)) {
+ for (dinfo = tctx->domains; dinfo;
+ dinfo = get_next_domain(dinfo, SSS_GND_DESCEND)) {
if (!IS_SUBDOMAIN(dinfo)) {
/* Update list of subdomains for this domain */
ret = sysdb_update_subdomains(dinfo);
@@ -555,7 +556,7 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain)
}
}
- for (dinfo = ctx->domains; dinfo; dinfo = get_next_domain(dinfo, false)) {
+ for (dinfo = ctx->domains; dinfo; dinfo = get_next_domain(dinfo, 0)) {
ret = sss_names_init(ctx, ctx->confdb, dinfo->name, &dinfo->names);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "sss_names_init() failed\n");
diff --git a/src/tools/sss_debuglevel.c b/src/tools/sss_debuglevel.c
index 333de2199..e1467c01f 100644
--- a/src/tools/sss_debuglevel.c
+++ b/src/tools/sss_debuglevel.c
@@ -261,7 +261,7 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb,
for (domain = domain_list;
domain;
- domain = get_next_domain(domain, false)) {
+ domain = get_next_domain(domain, 0)) {
domain_count++;
}
@@ -286,7 +286,7 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb,
for (domain = domain_list;
domain;
- domain = get_next_domain(domain, false), i++) {
+ domain = get_next_domain(domain, 0), i++) {
sections[i] = talloc_asprintf(tmp_ctx, CONFDB_DOMAIN_PATH_TMPL,
domain->name);
if (sections[i] == NULL) {
diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c
index 7441e19e2..041c2a106 100644
--- a/src/tools/sss_override.c
+++ b/src/tools/sss_override.c
@@ -1281,7 +1281,7 @@ static int override_user_export(struct sss_cmdline *cmdline,
/* All overrides are under the same subtree, so we don't want to
* descent into subdomains. */
- dom = get_next_domain(dom, false);
+ dom = get_next_domain(dom, 0);
} while (dom != NULL);
exit = EXIT_SUCCESS;
@@ -1482,7 +1482,7 @@ static int override_group_export(struct sss_cmdline *cmdline,
/* All overrides are under the same subtree, so we don't want to
* descent into subdomains. */
- dom = get_next_domain(dom, false);
+ dom = get_next_domain(dom, 0);
} while (dom != NULL);
exit = EXIT_SUCCESS;