diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-08-18 15:15:44 +0000 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-21 17:03:01 +0200 |
commit | b5825c74b6bf7a99ae2172392dbecb51179013a6 (patch) | |
tree | 54b4e9904ed901c13cccbacad5b62c0a824205df /src/db | |
parent | 2cec08a3174bff951c048c57b4b0e4517ad6b7b1 (diff) | |
download | sssd-b5825c74b6bf7a99ae2172392dbecb51179013a6.tar.gz sssd-b5825c74b6bf7a99ae2172392dbecb51179013a6.tar.xz sssd-b5825c74b6bf7a99ae2172392dbecb51179013a6.zip |
UTIL: Convert domain->disabled into tri-state with domain states
Required for:
https://fedorahosted.org/sssd/ticket/2637
This is a first step towards making it possible for domain to be around,
but not contacted by Data Provider.
Also explicitly create domains as active, previously we only relied on
talloc_zero marking dom->disabled as false.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb_subdomains.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 142520c18..546dc1c8d 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -111,6 +111,8 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, dom->enumerate = enumerate; dom->fqnames = true; dom->mpg = mpg; + dom->state = DOM_ACTIVE; + /* If the parent domain filters out group members, the subdomain should * as well if configured */ inherit_option = string_in_list(CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS, @@ -268,7 +270,7 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) /* disable all domains, * let the search result refresh any that are still valid */ for (dom = domain->subdomains; dom; dom = get_next_domain(dom, false)) { - dom->disabled = true; + sss_domain_set_state(dom, DOM_DISABLED); } if (res->count == 0) { @@ -312,7 +314,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) /* explicitly use dom->next as we need to check 'disabled' domains */ for (dom = domain->subdomains; dom; dom = dom->next) { if (strcasecmp(dom->name, name) == 0) { - dom->disabled = false; + sss_domain_set_state(dom, DOM_ACTIVE); + /* in theory these may change, but it should never happen */ if (strcasecmp(dom->realm, realm) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, |