diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util/domain_info_utils.c | 13 | ||||
-rw-r--r-- | src/util/util.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 7b1eb1a3..7ac4d9d0 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -27,6 +27,19 @@ /* the directory domain - realm mappings are written to */ #define KRB5_MAPPING_DIR PUBCONF_PATH"/krb5.include.d" +struct sss_domain_info *get_domains_head(struct sss_domain_info *domain) +{ + struct sss_domain_info *dom = NULL; + + /* get to the top level domain */ + for (dom = domain; dom->parent != NULL; dom = dom->parent); + + /* proceed to the list head */ + for (; dom->prev != NULL; dom = dom->prev); + + return dom; +} + struct sss_domain_info *get_next_domain(struct sss_domain_info *domain, bool descend) { diff --git a/src/util/util.h b/src/util/util.h index 20d230c1..6cd59d96 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -543,6 +543,8 @@ struct sized_string { void to_sized_string(struct sized_string *out, const char *in); /* from domain_info.c */ +struct sss_domain_info *get_domains_head(struct sss_domain_info *domain); + struct sss_domain_info *get_next_domain(struct sss_domain_info *domain, bool descend); struct sss_domain_info *find_subdomain_by_name(struct sss_domain_info *domain, |