On 08/08/2012 04:24 PM, Jakub Hrozek wrote:
On Wed, Aug 08, 2012 at 02:23:04PM +0200, Pavel Březina wrote:
This bug was probably introduced with the subdomain patches. The
problem was that sss_dp_get_domains_send() is called even for the local
provider. There are certainly many possible solutions of this issue. I
decided to modify sss_dp_issue_request() to call the callback
immediately if it is issued for local domain. This way, I believe, we
can avoid further problems with issuing request for local domains.
I don't think this is the best solution.
First, it leaves the check_provider of the per-domain structures we use
in responders around while duplicating the same functionality in the DP.
At the very least, the patch should remove the "check_provider" tests from
the existing loops.
What I think would be even better solution is to
1) in the RC just fix the subdomains code so that it shortcuts or
doesn't run at all for LOCAL lookups.
Patch is attached.
2) The work we'll be doing later on #1126 would merge all the loops
into one common place.
This approach would have the benefit of all the checks being done at one
common place, so that we don't forget to add them like we did in the
subdomains case and at would be faster at the same time because it
wouldn't even contact the DP at all, much like it's done now in the
separate loops.
From 05540552ca69763e791177a36fd63fde8a8d7daa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrez...@redhat.com>
Date: Fri, 10 Aug 2012 09:24:22 +0200
Subject: [PATCH] Fix LOCAL domain lookups
https://fedorahosted.org/sssd/ticket/1436
Now subdomains are not evaluated for local domains.
---
src/responder/common/responder_get_domains.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index 2660d5e8006dea20383b66055ea976e82d0836e6..0a5c44c4f37b6eac1d90968c30632c730e3aecb0 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -109,16 +109,19 @@ static errno_t get_domains_next(struct tevent_req *req)
char *key;
info = tevent_req_data(req, struct sss_dp_domains_info);
+
+ /* Skip all local domains. */
+ while(info->dom != NULL && !NEED_CHECK_PROVIDER(info->dom->provider)) {
+ info->dom = info->dom->next;
+ }
+
if (info->dom == NULL) {
- /* Note that tevent_req_post() is not here. This will
- * influence the program only in case that this will
- * be the first call of the function (i.e. there is no
- * problem when this is called from get_domains_done(),
- * it is in fact required). In case no domains are in
- * the state, it should be treated as an error one level
- * above.
+ /* This may be the first call if all available domains are local.
+ * Therefore, we need to call tevent_req_post() to make sure that
+ * callback is called anyway.
*/
tevent_req_done(req);
+ tevent_req_post(req, info->rctx->ev);
return EOK;
}
--
1.7.6.5
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel