On Tue, 2009-09-01 at 16:33 -0400, Simo Sorce wrote:
> When enumerate is set to flse we don't return entries on an enumerating
> getent but we still run the enumeration task.
> 
> Obey the enumerate flag and don't start the task if it is set to false.
> 
> Simo.

Works better with the actual patch :-)

-- 
Simo Sorce * Red Hat, Inc * New York
>From 71864ff366b4600bdc066e117f5bdc4a897516c0 Mon Sep 17 00:00:00 2001
From: Simo Sorce <sso...@redhat.com>
Date: Tue, 1 Sep 2009 11:36:13 -0400
Subject: [PATCH 1/2] Honor enumerate option in ldap_id

If enumerations are disabled for this domain, then do not start the
enumeration task.
---
 server/providers/ldap/ldap_id.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/server/providers/ldap/ldap_id.c b/server/providers/ldap/ldap_id.c
index b5fdc63..5da21cd 100644
--- a/server/providers/ldap/ldap_id.c
+++ b/server/providers/ldap/ldap_id.c
@@ -1307,13 +1307,16 @@ int sssm_ldap_init(struct be_ctx *bectx,
     }
 
     /* set up enumeration task */
-    ctx->last_run = tevent_timeval_current(); /* run the first immediately */
-    enum_task = tevent_add_timer(ctx->be->ev, ctx, ctx->last_run,
+    if (ctx->be->domain->enumerate) {
+        /* run the first immediately */
+        ctx->last_run = tevent_timeval_current();
+        enum_task = tevent_add_timer(ctx->be->ev, ctx, ctx->last_run,
                                  ldap_id_enumerate, ctx);
-    if (!enum_task) {
-        DEBUG(0, ("FATAL: failed to setup enumeration task!\n"));
-        ret = EFAULT;
-        goto done;
+        if (!enum_task) {
+            DEBUG(0, ("FATAL: failed to setup enumeration task!\n"));
+            ret = EFAULT;
+            goto done;
+        }
     }
 
     *ops = &sdap_id_ops;
-- 
1.6.2.5

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to