[SSSD] [PATCH] Two AD enumeration patches

Jakub Hrozek jhrozek at redhat.com
Tue Feb 11 16:37:38 UTC 2014


Hi,

attached are two more patches for issues I found when testing the POSIX
detection code.

[PATCH 1/2] AD: Only download domains that are set to enumerate
This is a bug caused by the recent subdomain enumeration patches. The
code always downloaded all domains even if subdomain_enumerate was set
to false. This bug was not easy to spot, because the NSS frontend
filtered the request for subdomain enumeration correctly, "just" the
backend downloaded too much data.

[PATCH 2/2] AD: Remove dead code
As the subject says, just removing some dead code.
-------------- next part --------------
>From 8a09b715e64605a35d9216d6b2196d0b10ac8646 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Wed, 5 Feb 2014 16:39:47 +0100
Subject: [PATCH 1/2] AD: Only download domains that are set to enumerate

---
 src/providers/ad/ad_id.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index 9e748a24adf47b5b2c4b92e8e0df219e160fcbba..e1ecd3fbe4f7f556fb57f8b683f5dcf4c72ac31d 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -660,7 +660,11 @@ ad_enumeration_done(struct tevent_req *subreq)
         return;
     }
 
-    state->sditer = state->sditer->next;
+    do {
+        state->sditer = state->sditer->next;
+    } while (state->sditer &&
+             state->sditer->dom->enumerate == false);
+
     if (state->sditer != NULL) {
         subdom_id_ctx = talloc_get_type(state->sdom->pvt, struct ad_id_ctx);
         if (subdom_id_ctx == NULL) {
-- 
1.8.5.3

-------------- next part --------------
>From 8208adc2e46ef93981c7e91c8275b5c2e9ac91c6 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Wed, 5 Feb 2014 16:40:41 +0100
Subject: [PATCH 2/2] AD: Remove dead code

---
 src/providers/ad/ad_id.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index e1ecd3fbe4f7f556fb57f8b683f5dcf4c72ac31d..6e2fe53b0e0912037069f715f8dd83ddc069150a 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -634,7 +634,6 @@ ad_enumeration_done(struct tevent_req *subreq)
                                                       struct tevent_req);
     struct ad_enumeration_state *state = tevent_req_data(req,
                                                 struct ad_enumeration_state);
-    struct ad_id_ctx *subdom_id_ctx;
 
     ret = sdap_dom_enum_ex_recv(subreq);
     talloc_zfree(subreq);
@@ -666,13 +665,6 @@ ad_enumeration_done(struct tevent_req *subreq)
              state->sditer->dom->enumerate == false);
 
     if (state->sditer != NULL) {
-        subdom_id_ctx = talloc_get_type(state->sdom->pvt, struct ad_id_ctx);
-        if (subdom_id_ctx == NULL) {
-            DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot retrieve subdomain ad_id_ctx!\n"));
-            tevent_req_error(req, EFAULT);
-            return;
-        }
-
         ret = ad_enum_sdom(req, state->sditer, state->sditer->pvt);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, ("Could not enumerate domain %s\n",
-- 
1.8.5.3



More information about the sssd-devel mailing list