summaryrefslogtreecommitdiff
path: root/src/responder/common
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-15 22:19:36 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:47 +0100
commit4f118e3e6a25762f40a43e6dbefb09f44adbef32 (patch)
tree35e3eed19b3b462cc94f6aee0050562a7d37e6a8 /src/responder/common
parentbfba0655bc129ebcffc20b1204e0f87549e0a74e (diff)
downloadsssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.tar.gz
sssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.tar.bz2
sssd-4f118e3e6a25762f40a43e6dbefb09f44adbef32.zip
Introduce IS_SUBDOMAIN() macro
Fixes https://fedorahosted.org/sssd/ticket/1766
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/responder_common.c6
-rw-r--r--src/responder/common/responder_get_domains.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 877181f8..c7aead3e 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -894,15 +894,15 @@ responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx,
struct sss_domain_info *ret_dom = NULL;
for (dom = rctx->domains; dom; dom = get_next_domain(dom, true)) {
- if (!dom->parent) {
+ if (!IS_SUBDOMAIN(dom)) {
time_diff = now - dom->subdomains_last_checked.tv_sec;
}
if (strcasecmp(dom->name, name) == 0 ||
(dom->flat_name != NULL &&
strcasecmp(dom->flat_name, name) == 0)) {
ret_dom = dom;
- if (!dom->parent ||
- (dom->parent && time_diff < rctx->domains_timeout)) {
+ if (!IS_SUBDOMAIN(dom) ||
+ (IS_SUBDOMAIN(dom) && time_diff < rctx->domains_timeout)) {
break;
}
}
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index b69875e1..defa4a43 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -353,7 +353,7 @@ static errno_t check_last_request(struct resp_ctx *rctx, const char *hint)
if (hint != NULL) {
for (dom = rctx->domains; dom; dom = get_next_domain(dom, true)) {
- if (dom->parent == NULL) {
+ if (!IS_SUBDOMAIN(dom)) {
diff = now - dom->subdomains_last_checked.tv_sec;
/* not a subdomain */
continue;