diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/domain_info_utils.c | 2 | ||||
-rw-r--r-- | src/util/util.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 6db7e157..d8ca55da 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -33,7 +33,7 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain, dom = dom->subdomains; } else if (dom->next) { dom = dom->next; - } else if (descend && dom->parent) { + } else if (descend && IS_SUBDOMAIN(dom)) { dom = dom->parent->next; } else { return NULL; diff --git a/src/util/util.h b/src/util/util.h index 7697dbb5..7026f0b9 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -585,6 +585,8 @@ errno_t sssd_domain_init(TALLOC_CTX *mem_ctx, const char *db_path, struct sss_domain_info **_domain); +#define IS_SUBDOMAIN(dom) ((dom)->parent != NULL) + /* from util_lock.c */ errno_t sss_br_lock_file(int fd, size_t start, size_t len, int num_tries, useconds_t wait); |