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/confdb | |
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/confdb')
-rw-r--r-- | src/confdb/confdb.c | 2 | ||||
-rw-r--r-- | src/confdb/confdb.h | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index 3a8a1c01b..c097aad77 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -1342,6 +1342,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, domain->has_views = false; domain->view_name = NULL; + domain->state = DOM_ACTIVE; + *_domain = domain; ret = EOK; done: diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h index 427c309a2..eca3d4475 100644 --- a/src/confdb/confdb.h +++ b/src/confdb/confdb.h @@ -216,6 +216,23 @@ struct confdb_ctx; struct config_file_ctx; +/** sssd domain state */ +enum sss_domain_state { + /** Domain is usable by both responders and providers. This + * is the default state after creating a new domain + */ + DOM_ACTIVE, + /** Domain was removed, should not be used be neither responders + * not providers. + */ + DOM_DISABLED, + /** Domain cannot be contacted. Providers return an offline error code + * when receiving request for inactive domain, but responders should + * return cached data + */ + DOM_INACTIVE, +}; + /** * Data structure storing all of the basic features * of a domain. @@ -278,7 +295,7 @@ struct sss_domain_info { struct sss_domain_info *prev; struct sss_domain_info *next; - bool disabled; + enum sss_domain_state state; char **sd_inherit; /* Do not use the forest pointer directly in new code, but rather the |