diff options
author | Sumit Bose <sbose@redhat.com> | 2013-10-21 14:02:57 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-10-22 19:11:36 +0200 |
commit | fab48878db202d620f43c9da23e375866d1db2c6 (patch) | |
tree | fed9a9cd88f9e00221946161b74fe57c5c0925cf | |
parent | 0a320004a9937295ba66a348d1e60682cfdceb26 (diff) | |
download | sssd-fab48878db202d620f43c9da23e375866d1db2c6.tar.gz sssd-fab48878db202d620f43c9da23e375866d1db2c6.tar.xz sssd-fab48878db202d620f43c9da23e375866d1db2c6.zip |
IPA: add callback to reset subdomain timeouts
Fixes https://fedorahosted.org/sssd/ticket/2030
-rw-r--r-- | src/providers/ipa/ipa_subdomains.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index ea55f70f1..d6cb0c6b6 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -1106,6 +1106,21 @@ static void ipa_subdom_be_req_callback(struct be_req *be_req, talloc_free(be_req); } +static void ipa_subdom_reset_timeouts_cb(void *pvt) +{ + struct ipa_subdomains_ctx *ctx; + + ctx = talloc_get_type(pvt, struct ipa_subdomains_ctx); + if (ctx == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("Bad private pointer\n")); + return; + } + + DEBUG(SSSDBG_TRACE_ALL, ("Resetting last_refreshed and disabled_until.\n")); + ctx->last_refreshed = 0; + ctx->disabled_until = 0; +} + static void ipa_subdom_online_cb(void *pvt) { struct ipa_subdomains_ctx *ctx; @@ -1252,6 +1267,14 @@ int ipa_subdom_init(struct be_ctx *be_ctx, *ops = &ipa_subdomains_ops; *pvt_data = ctx; + ret = be_add_unconditional_online_cb(ctx, be_ctx, + ipa_subdom_reset_timeouts_cb, ctx, + NULL); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, + ("Failed to add subdom reset timeouts callback")); + } + ret = be_add_online_cb(ctx, be_ctx, ipa_subdom_online_cb, ctx, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom online callback")); |