diff options
Diffstat (limited to 'src/util/domain_info_utils.c')
-rw-r--r-- | src/util/domain_info_utils.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 4eabcff7a..ffbb9475b 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -50,7 +50,10 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain, } else { dom = NULL; } - if (dom && !dom->disabled) break; + + if (dom && sss_domain_get_state(dom) != DOM_DISABLED) { + break; + } } return dom; @@ -91,7 +94,7 @@ struct sss_domain_info *find_domain_by_name(struct sss_domain_info *domain, return NULL; } - while (dom && dom->disabled) { + while (dom && sss_domain_get_state(dom) == DOM_DISABLED) { dom = get_next_domain(dom, true); } while (dom) { @@ -119,7 +122,7 @@ struct sss_domain_info *find_domain_by_sid(struct sss_domain_info *domain, sid_len = strlen(sid); - while (dom && dom->disabled) { + while (dom && sss_domain_get_state(dom) == DOM_DISABLED) { dom = get_next_domain(dom, true); } @@ -730,3 +733,14 @@ done: return ret; } + +enum sss_domain_state sss_domain_get_state(struct sss_domain_info *dom) +{ + return dom->state; +} + +void sss_domain_set_state(struct sss_domain_info *dom, + enum sss_domain_state state) +{ + dom->state = state; +} |