From 3bd78eb2faf09635b8d307e4440ccb1420f80716 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Sun, 19 May 2013 17:36:54 +0200 Subject: Fix dyndns timer initialization The dyndns init function was starting the timer even if the updates were set to False. This patch splits the init of dynamic updates and the timer into two functions so that the back end can start the updates separately from reading the options. --- src/providers/ad/ad_common.c | 4 ++-- src/providers/ad/ad_dyndns.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/providers/ad') diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c index e0a55c6dc..e34199959 100644 --- a/src/providers/ad/ad_common.c +++ b/src/providers/ad/ad_common.c @@ -705,8 +705,8 @@ errno_t ad_get_dyndns_options(struct be_ctx *be_ctx, { errno_t ret; - ret = be_nsupdate_init(ad_opts, be_ctx, ad_dyndns_opts, ad_dyndns_timer, - ad_opts, &ad_opts->dyndns_ctx); + ret = be_nsupdate_init(ad_opts, be_ctx, ad_dyndns_opts, + &ad_opts->dyndns_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize AD dyndns opts [%d]: %s\n", diff --git a/src/providers/ad/ad_dyndns.c b/src/providers/ad/ad_dyndns.c index 2b2d24625..4e9ed852f 100644 --- a/src/providers/ad/ad_dyndns.c +++ b/src/providers/ad/ad_dyndns.c @@ -70,6 +70,13 @@ errno_t ad_dyndns_init(struct be_ctx *be_ctx, return EINVAL; } + ret = be_nsupdate_init_timer(ad_opts->dyndns_ctx, be_ctx->ev, + ad_dyndns_timer, ad_opts); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up periodic update\n")); + return ret; + } + ret = be_add_online_cb(be_ctx, be_ctx, ad_dyndns_update, ad_opts, NULL); -- cgit