summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-08-21 17:28:47 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-28 18:06:57 +0200
commita6cca9c284724fafd670a3163812f248ba53ad97 (patch)
tree868405021cbbe1f8b00da5b978df5a7403f3858d /src/db
parentb3458bbb5315b05d7ac1abc58f1c380761756603 (diff)
downloadsssd-a6cca9c284724fafd670a3163812f248ba53ad97.tar.gz
sssd-a6cca9c284724fafd670a3163812f248ba53ad97.tar.xz
sssd-a6cca9c284724fafd670a3163812f248ba53ad97.zip
Read enumerate state for subdomains from cache
The enumerate flag will be read from the cache for subdomains and the domain object will be created accordingly.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_subdomains.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 2b80b5b9e..5ef9aef73 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -34,6 +34,7 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
SYSDB_SUBDOMAIN_FLAT,
SYSDB_SUBDOMAIN_ID,
SYSDB_SUBDOMAIN_MPG,
+ SYSDB_SUBDOMAIN_ENUM,
NULL};
struct sss_domain_info *dom;
struct ldb_dn *basedn;
@@ -42,6 +43,7 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
const char *flat;
const char *id;
bool mpg;
+ bool enumerate;
tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) {
@@ -96,6 +98,9 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
mpg = ldb_msg_find_attr_as_bool(res->msgs[i],
SYSDB_SUBDOMAIN_MPG, false);
+ enumerate = ldb_msg_find_attr_as_bool(res->msgs[i],
+ SYSDB_SUBDOMAIN_ENUM, false);
+
/* 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) {
@@ -143,12 +148,21 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
dom->mpg = mpg;
}
+ if (dom->enumerate != enumerate) {
+ DEBUG(SSSDBG_TRACE_INTERNAL,
+ ("MPG state change from [%s] to [%s]!\n",
+ dom->enumerate ? "true" : "false",
+ enumerate ? "true" : "false"));
+ dom->enumerate = enumerate;
+ }
+
break;
}
}
/* If not found in loop it is a new subdomain */
if (dom == NULL) {
- dom = new_subdomain(domain, domain, name, realm, flat, id, mpg);
+ dom = new_subdomain(domain, domain, name, realm,
+ flat, id, mpg, enumerate);
if (dom == NULL) {
ret = ENOMEM;
goto done;