Hi,

I found this small GPO bug when testing Yassir's patches.
>From f40acbdf00eeb6a7e06b589cbe43be5e6af0de10 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Fri, 25 Jul 2014 17:39:54 +0200
Subject: [PATCH] AD: Increment som_index when advancing to the next GPO

When the GPO processing tried to advance to the next GPO on encountering
an error, the som_index was not incremented, causing an infinite loop.
---
 src/providers/ad/ad_gpo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c
index 
a1cce057ef874ea84c8a0312ce32f8b437ff5c78..7f86000c8c9be81ab0e0023342ba096fb0e18989
 100644
--- a/src/providers/ad/ad_gpo.c
+++ b/src/providers/ad/ad_gpo.c
@@ -2022,6 +2022,7 @@ ad_gpo_get_som_attrs_done(struct tevent_req *subreq)
     }
     if ((num_results < 1) || (results == NULL)) {
         DEBUG(SSSDBG_OP_FAILURE, "no attrs found for SOM; try next SOM.\n");
+        state->som_index++;
         ret = ad_gpo_get_som_attrs_step(req);
         goto done;
     } else if (num_results > 1) {
@@ -2042,6 +2043,7 @@ ad_gpo_get_som_attrs_done(struct tevent_req *subreq)
 
     if ((ret == ENOENT) || (el->num_values == 0)) {
         DEBUG(SSSDBG_OP_FAILURE, "no attrs found for SOM; try next SOM\n");
+        state->som_index++;
         ret = ad_gpo_get_som_attrs_step(req);
         goto done;
     }
-- 
1.9.3

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to