summaryrefslogtreecommitdiff
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 17:14:32 -0400
commitdd025b4cbd501e2f34461f9d8359a829b81f5c2f (patch)
treeb04795563e7072d0b66ad28383d00624656363fa /src/providers/proxy.c
parent96a6aa73a6ea0982b349ac10b82aaf86d03ec5f5 (diff)
downloadsssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.gz
sssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.bz2
sssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.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 c7aef308..ac5cf7fe 100644
--- a/src/providers/proxy.c
+++ b/src/providers/proxy.c
@@ -277,6 +277,16 @@ static void proxy_pam_handler(struct be_req *req) {
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);
}