diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-22 11:03:01 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-28 18:06:57 +0200 |
commit | 1c4144a6ce68dbd54c7c08a517d1f982ea57f19a (patch) | |
tree | c81298a84cd4160834999821a179faf666fd4cc9 /src/providers/ldap/ldap_common.c | |
parent | 66edf42c51f8591c93204b6490c103fa51346f47 (diff) | |
download | sssd-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.c | 17 |
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; |