From 877b92e80bde510d5cd9f03dbf01e2bcf73ab072 Mon Sep 17 00:00:00 2001 From: Michal Židek Date: Wed, 9 Sep 2015 14:37:48 +0200 Subject: 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 --- src/tools/common/sss_tools.c | 6 ++++-- src/tools/sss_cache.c | 5 +++-- src/tools/sss_debuglevel.c | 4 ++-- src/tools/sss_override.c | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/tools') diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools.c index 0ada62e3..c0b52555 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 c9bf2491..88895e8d 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 333de219..e1467c01 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 7441e19e..041c2a10 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; -- cgit