summaryrefslogtreecommitdiff
path: root/src/providers/ldap/ldap_common.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-08-21 01:41:16 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-28 18:06:57 +0200
commit5894f059b6f97a9dfd63f6e9ab544c636dd58665 (patch)
tree769b5a20631b511bd2aefbe6abffa8b79820c27e /src/providers/ldap/ldap_common.c
parent8ca73915a3bf60331468fed6b3b38652c979f95d (diff)
downloadsssd-5894f059b6f97a9dfd63f6e9ab544c636dd58665.tar.gz
sssd-5894f059b6f97a9dfd63f6e9ab544c636dd58665.tar.bz2
sssd-5894f059b6f97a9dfd63f6e9ab544c636dd58665.zip
LDAP: Convert enumeration to the ptask API
https://fedorahosted.org/sssd/ticket/1942 Identity providers other than LDAP need to customize the enumeration in different ways while sharing the way the task is scheduled etc. The easiest way to accomplish it is to leverage the recently introduced ptask framework.
Diffstat (limited to 'src/providers/ldap/ldap_common.c')
-rw-r--r--src/providers/ldap/ldap_common.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 9aa98173..05e487a1 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -941,37 +941,11 @@ int sdap_id_setup_tasks(struct sdap_id_ctx *ctx)
struct timeval tv;
int ret = EOK;
int delay;
- bool has_enumerated;
/* set up enumeration task */
if (ctx->be->domain->enumerate) {
- /* If this is the first startup, we need to kick off
- * an enumeration immediately, to close a window where
- * clients requesting get*ent information won't get an
- * immediate reply with no entries
- */
- ret = sysdb_has_enumerated(ctx->be->domain->sysdb, ctx->be->domain,
- &has_enumerated);
- if (ret != EOK) {
- return ret;
- }
- if (has_enumerated) {
- /* At least one enumeration has previously run,
- * so clients will get cached data. We will delay
- * starting to enumerate by 10s so we don't slow
- * down the startup process if this is happening
- * during system boot.
- */
- tv = tevent_timeval_current_ofs(10, 0);
- } else {
- /* This is our first startup. Schedule the
- * enumeration to start immediately once we
- * enter the mainloop.
- */
- tv = tevent_timeval_current();
- }
-
- ret = ldap_id_enumerate_set_timer(ctx, tv);
+ DEBUG(SSSDBG_TRACE_FUNC, ("Setting up enumeration for %s\n", ctx->be->domain->name));
+ ret = ldap_setup_enumeration(ctx, ctx->conn, ctx->opts->sdom);
} else {
/* the enumeration task, runs the cleanup process by itself,
* but if enumeration is not running we need to schedule it */