diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/confdb/confdb.h | 2 | ||||
-rw-r--r-- | src/util/domain_info_utils.c | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h index 45412538..71c30367 100644 --- a/src/confdb/confdb.h +++ b/src/confdb/confdb.h @@ -238,6 +238,8 @@ struct sss_domain_info { struct timeval subdomains_last_checked; struct sss_domain_info *next; + + bool disabled; }; /** diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 8cba7dca..59d5c534 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -28,15 +28,19 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain, struct sss_domain_info *dom; dom = domain; - if (descend && dom->subdomain_count > 0) { - dom = dom->subdomains[0]; - } else if (dom->next) { - dom = dom->next; - } else if (descend && dom->parent) { - dom = dom->parent->next; - } else { - dom = NULL; + while (dom) { + if (descend && dom->subdomain_count > 0) { + dom = dom->subdomains[0]; + } else if (dom->next) { + dom = dom->next; + } else if (descend && dom->parent) { + dom = dom->parent->next; + } else { + return NULL; + } + if (!dom->disabled) break; } + return dom; } |