summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_connection.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/ldap/sdap_async_connection.c
parent96a6aa73a6ea0982b349ac10b82aaf86d03ec5f5 (diff)
downloadsssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.gz
sssd-dd025b4cbd501e2f34461f9d8359a829b81f5c2f.tar.xz
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/ldap/sdap_async_connection.c')
-rw-r--r--src/providers/ldap/sdap_async_connection.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 17cd55863..bd8d4e960 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -813,6 +813,7 @@ struct sdap_cli_connect_state {
struct tevent_context *ev;
struct sdap_options *opts;
struct sdap_service *service;
+ struct be_ctx *be;
bool use_rootdse;
struct sysdb_attrs *rootdse;
@@ -851,6 +852,7 @@ struct tevent_req *sdap_cli_connect_send(TALLOC_CTX *memctx,
state->service = service;
state->be = be;
state->srv = NULL;
+ state->be = be;
if (rootdse) {
state->use_rootdse = true;
@@ -1123,6 +1125,8 @@ static void sdap_cli_auth_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(subreq,
struct tevent_req);
+ struct sdap_cli_connect_state *state = tevent_req_data(req,
+ struct sdap_cli_connect_state);
enum sdap_result result;
int ret;
@@ -1137,6 +1141,11 @@ static void sdap_cli_auth_done(struct tevent_req *subreq)
return;
}
+ /* Reconnection succeeded
+ * Run any post-connection routines
+ */
+ be_run_online_cb(state->be);
+
tevent_req_done(req);
}