[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] fix id enumeration



This patch should solve ticket 21 but I have not tested it yet.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
>From c945ec74a84bb230b8cc05cc6e9ab3a3a1ddb140 Mon Sep 17 00:00:00 2001
From: Simo Sorce <ssorce redhat com>
Date: Thu, 16 Apr 2009 09:54:07 -0400
Subject: [PATCH] Fix by_id enumeration with multiple domains

We need to stop parsing domains as soon as a caaandidate is found and let the
callback search additional domains if the id is not found.
Should fix ticket #21
---
 server/responder/nss/nsssrv_cmd.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index ba444cc..0f0c0b9 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -858,6 +858,9 @@ static int nss_cmd_getpwuid(struct cli_ctx *cctx)
     }
     cmdctx->id = *((uint32_t *)body);
 
+    /* this is a multidomain search */
+    cmdctx->check_next = true;
+
     for (dom = cctx->rctx->domains; dom; dom = dom->next) {
         /* verify this user has not yet been negatively cached,
          * or has been permanently filtered */
@@ -890,6 +893,8 @@ static int nss_cmd_getpwuid(struct cli_ctx *cctx)
         if (ret != EOK) {
             DEBUG(1, ("Failed to make request to our cache!\n"));
         }
+
+        break;
     }
 
 done:
@@ -2205,6 +2210,9 @@ static int nss_cmd_getgrgid(struct cli_ctx *cctx)
     }
     cmdctx->id = *((uint32_t *)body);
 
+    /* this is a multidomain search */
+    cmdctx->check_next = true;
+
     for (dom = cctx->rctx->domains; dom; dom = dom->next) {
         /* verify this user has not yet been negatively cached,
          * or has been permanently filtered */
@@ -2237,6 +2245,8 @@ static int nss_cmd_getgrgid(struct cli_ctx *cctx)
         if (ret != EOK) {
             DEBUG(1, ("Failed to make request to our cache!\n"));
         }
+
+        break;
     }
 
 done:
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]