summaryrefslogtreecommitdiffstats
path: root/src/providers/proxy.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-04-27 14:57:37 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-05-07 16:38:23 -0400
commit8af798967f76df5cc96952a11d425e6ba9f10864 (patch)
tree2fce6ee54545064bc071d8cfacb4ef4a3dfede0c /src/providers/proxy.c
parent63b072f1c9b78b8a1877b32acc02b61bd1f04f12 (diff)
downloadsssd_unused-8af798967f76df5cc96952a11d425e6ba9f10864.tar.gz
sssd_unused-8af798967f76df5cc96952a11d425e6ba9f10864.tar.xz
sssd_unused-8af798967f76df5cc96952a11d425e6ba9f10864.zip
Add callback when the ID provider switches from offline to online
Allow backends to set a callback in the be_ctx that should be invoked when the ID provider goes online. This can be used to perform regular maintenance tasks that are valid only when going online.
Diffstat (limited to 'src/providers/proxy.c')
-rw-r--r--src/providers/proxy.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/providers/proxy.c b/src/providers/proxy.c
index 09a2555c..d3ec7ef3 100644
--- a/src/providers/proxy.c
+++ b/src/providers/proxy.c
@@ -296,6 +296,16 @@ static void proxy_pam_handler_cache_done(struct tevent_req *subreq)
static void proxy_reply(struct be_req *req, int dp_err,
int error, const char *errstr)
{
+ if (!req->be_ctx->offstat.offline) {
+ /* This action took place online.
+ * Fire any online callbacks if necessary.
+ * Note: we're checking the offline value directly,
+ * because if the activity took a long time to
+ * complete, calling be_is_offline() might report false
+ * incorrectly.
+ */
+ be_run_online_cb(req->be_ctx);
+ }
return req->fn(req, dp_err, error, errstr);
}