summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_common.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-08-22 11:03:01 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-28 18:06:57 +0200
commit1c4144a6ce68dbd54c7c08a517d1f982ea57f19a (patch)
treec81298a84cd4160834999821a179faf666fd4cc9 /src/providers/ldap/ldap_common.c
parent66edf42c51f8591c93204b6490c103fa51346f47 (diff)
downloadsssd-1c4144a6ce68dbd54c7c08a517d1f982ea57f19a.tar.gz
sssd-1c4144a6ce68dbd54c7c08a517d1f982ea57f19a.tar.xz
sssd-1c4144a6ce68dbd54c7c08a517d1f982ea57f19a.zip
LDAP: Make sdap_id_setup_tasks reusable for subdomains
Instead of always performing the setup for the main domain, the setup can now be performed for subdomains as well.
Diffstat (limited to 'src/providers/ldap/ldap_common.c')
-rw-r--r--src/providers/ldap/ldap_common.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index ffa8aae59..f7ad71182 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -936,16 +936,23 @@ void sdap_mark_offline(struct sdap_id_ctx *ctx)
be_mark_offline(ctx->be);
}
-int sdap_id_setup_tasks(struct sdap_id_ctx *ctx)
+int ldap_id_setup_tasks(struct sdap_id_ctx *ctx)
+{
+ return sdap_id_setup_tasks(ctx, ctx->conn, ctx->opts->sdom);
+}
+
+int sdap_id_setup_tasks(struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
+ struct sdap_domain *sdom)
{
struct timeval tv;
int ret = EOK;
int delay;
/* set up enumeration task */
- if (ctx->be->domain->enumerate) {
- DEBUG(SSSDBG_TRACE_FUNC, ("Setting up enumeration for %s\n", ctx->be->domain->name));
- ret = ldap_setup_enumeration(ctx, ctx->conn, ctx->opts->sdom);
+ if (sdom->dom->enumerate) {
+ DEBUG(SSSDBG_TRACE_FUNC, ("Setting up enumeration for %s\n", sdom->dom->name));
+ ret = ldap_setup_enumeration(ctx, conn, sdom);
} else {
/* the enumeration task, runs the cleanup process by itself,
* but if enumeration is not running we need to schedule it */
@@ -960,7 +967,7 @@ int sdap_id_setup_tasks(struct sdap_id_ctx *ctx)
/* run the first one in a couple of seconds so that we have time to
* finish initializations first*/
tv = tevent_timeval_current_ofs(10, 0);
- ret = ldap_id_cleanup_create_timer(ctx, ctx->opts->sdom, tv);
+ ret = ldap_id_cleanup_create_timer(ctx, sdom, tv);
}
return ret;