diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-14 17:04:00 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-02-10 22:08:47 +0100 |
commit | 0232747f04b650796db56fd7b487aee8a96fab03 (patch) | |
tree | 0c0329a59cbb66b1e4ea4983cd034dc9015245dc /src/responder/common | |
parent | 95e94691178297f2b8225a83d43ae388cab04b45 (diff) | |
download | sssd-0232747f04b650796db56fd7b487aee8a96fab03.tar.gz sssd-0232747f04b650796db56fd7b487aee8a96fab03.tar.xz sssd-0232747f04b650796db56fd7b487aee8a96fab03.zip |
Add function get_next_domain()
Use this function instead of explicitly calling domain->next
This function allows to get the next primary domain or to descend into the
subdomains and replaces also get_next_dom_or_subdom()
Diffstat (limited to 'src/responder/common')
-rw-r--r-- | src/responder/common/negcache.c | 8 | ||||
-rw-r--r-- | src/responder/common/responder_common.c | 4 | ||||
-rw-r--r-- | src/responder/common/responder_get_domains.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 5be1ea688..57d1fc8b3 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -579,7 +579,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, int i; /* Populate domain-specific negative cache entries */ - for (dom = domain_list; dom; dom = dom->next) { + for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { conf_path = talloc_asprintf(tmpctx, CONFDB_DOMAIN_PATH_TMPL, dom->name); if (!conf_path) { @@ -667,7 +667,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, continue; } } else { - for (dom = domain_list; dom; dom = dom->next) { + for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { ret = sss_ncache_set_user(ncache, true, dom, name); if (ret != EOK) { DEBUG(1, ("Failed to store permanent user filter for" @@ -681,7 +681,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, } filter_set = false; - for (dom = domain_list; dom; dom = dom->next) { + for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { conf_path = talloc_asprintf(tmpctx, CONFDB_DOMAIN_PATH_TMPL, dom->name); if (!conf_path) { ret = ENOMEM; @@ -765,7 +765,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, continue; } } else { - for (dom = domain_list; dom; dom = dom->next) { + for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { ret = sss_ncache_set_group(ncache, true, dom, name); if (ret != EOK) { DEBUG(1, ("Failed to store permanent group filter for" diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 9defdba46..3a634e03b 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -817,7 +817,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx, return ret; } - for (dom = rctx->domains; dom; dom = dom->next) { + for (dom = rctx->domains; dom; dom = get_next_domain(dom, false)) { ret = sss_names_init(rctx->cdb, rctx->cdb, dom->name, &dom->names); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, @@ -894,7 +894,7 @@ responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx, struct sss_domain_info *ret_dom = NULL; int i; - for (dom = rctx->domains; dom; dom = dom->next) { + for (dom = rctx->domains; dom; dom = get_next_domain(dom, false)) { if (strcasecmp(dom->name, domain) == 0 || (dom->flat_name != NULL && strcasecmp(dom->flat_name, domain) == 0)) { diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c index 7049d60a8..77e2b146d 100644 --- a/src/responder/common/responder_get_domains.c +++ b/src/responder/common/responder_get_domains.c @@ -192,7 +192,7 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx, state->dom = rctx->domains; while(state->dom != NULL && !NEED_CHECK_PROVIDER(state->dom->provider)) { - state->dom = state->dom->next; + state->dom = get_next_domain(state->dom, false); } if (state->dom == NULL) { @@ -249,11 +249,11 @@ sss_dp_get_domains_process(struct tevent_req *subreq) } /* Advance to the next domain */ - state->dom = state->dom->next; + state->dom = get_next_domain(state->dom, false); /* Skip local domains */ while(state->dom != NULL && !NEED_CHECK_PROVIDER(state->dom->provider)) { - state->dom = state->dom->next; + state->dom = get_next_domain(state->dom, false); } if (state->dom == NULL) { @@ -391,7 +391,7 @@ static errno_t check_last_request(struct resp_ctx *rctx, const char *hint) break; } } - dom = dom->next; + dom = get_next_domain(dom, false); } } |