summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-14 21:45:55 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:47 +0100
commit1f800ebb0f190854b8296146174f3d696a426333 (patch)
tree3b8ac0dcd332177f48ba4339442f6d8eae925534
parent0232747f04b650796db56fd7b487aee8a96fab03 (diff)
downloadsssd-1f800ebb0f190854b8296146174f3d696a426333.tar.gz
sssd-1f800ebb0f190854b8296146174f3d696a426333.tar.xz
sssd-1f800ebb0f190854b8296146174f3d696a426333.zip
Add ability to disable domains
-rw-r--r--src/confdb/confdb.h2
-rw-r--r--src/util/domain_info_utils.c20
2 files changed, 14 insertions, 8 deletions
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 45412538a..71c30367f 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -238,6 +238,8 @@ struct sss_domain_info {
struct timeval subdomains_last_checked;
struct sss_domain_info *next;
+
+ bool disabled;
};
/**
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index 8cba7dca7..59d5c534b 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -28,15 +28,19 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain,
struct sss_domain_info *dom;
dom = domain;
- if (descend && dom->subdomain_count > 0) {
- dom = dom->subdomains[0];
- } else if (dom->next) {
- dom = dom->next;
- } else if (descend && dom->parent) {
- dom = dom->parent->next;
- } else {
- dom = NULL;
+ while (dom) {
+ if (descend && dom->subdomain_count > 0) {
+ dom = dom->subdomains[0];
+ } else if (dom->next) {
+ dom = dom->next;
+ } else if (descend && dom->parent) {
+ dom = dom->parent->next;
+ } else {
+ return NULL;
+ }
+ if (!dom->disabled) break;
}
+
return dom;
}