From 0232747f04b650796db56fd7b487aee8a96fab03 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 14 Jan 2013 17:04:00 -0500 Subject: 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() --- src/responder/common/negcache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/responder/common/negcache.c') diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 5be1ea68..57d1fc8b 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" -- cgit