From 4f118e3e6a25762f40a43e6dbefb09f44adbef32 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 15 Jan 2013 22:19:36 -0500 Subject: Introduce IS_SUBDOMAIN() macro Fixes https://fedorahosted.org/sssd/ticket/1766 --- src/responder/common/responder_common.c | 6 +++--- src/responder/common/responder_get_domains.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/responder/common') 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; -- cgit