summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-05-18 12:18:13 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-05-27 14:44:14 -0400
commit8bb6aa3fd81a3c195b92270ddf189296abae65eb (patch)
tree04530219a755ca9c47ec13b8a8981d9e6faaf480
parentb21813c0bfa513b984fcbab81843c06d093332a5 (diff)
downloadsssd-8bb6aa3fd81a3c195b92270ddf189296abae65eb.tar.gz
sssd-8bb6aa3fd81a3c195b92270ddf189296abae65eb.tar.xz
sssd-8bb6aa3fd81a3c195b92270ddf189296abae65eb.zip
Add offline callback to disconnect global SDAP handle
-rw-r--r--src/providers/ipa/ipa_init.c7
-rw-r--r--src/providers/ldap/ldap_common.c10
-rw-r--r--src/providers/ldap/ldap_common.h1
-rw-r--r--src/providers/ldap/ldap_init.c7
4 files changed, 24 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 59e479e8b..f3fa610e5 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -175,6 +175,13 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
goto done;
}
+ ret = be_add_offline_cb(ctx, bectx, sdap_gsh_disconnect_callback, ctx,
+ NULL);
+ if (ret != EOK) {
+ DEBUG(1, ("be_add_offline_cb failed.\n"));
+ goto done;
+ }
+
ret = sdap_id_setup_tasks(ctx);
if (ret != EOK) {
goto done;
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 32057184f..1d62b7504 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -6,7 +6,7 @@
Authors:
Simo Sorce <ssorce@redhat.com>
- Copyright (C) 2008-2009 Red Hat
+ Copyright (C) 2008-2010 Red Hat
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -674,3 +674,11 @@ done:
return ret;
}
+void sdap_gsh_disconnect_callback(void *pvt)
+{
+ struct sdap_id_ctx *ctx = talloc_get_type(pvt, struct sdap_id_ctx);
+
+ if (ctx->gsh) {
+ ctx->gsh->connected = false;
+ }
+}
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index 3998e3001..53ffd6fe8 100644
--- a/src/providers/ldap/ldap_common.h
+++ b/src/providers/ldap/ldap_common.h
@@ -114,4 +114,5 @@ int groups_get_recv(struct tevent_req *req);
/* setup child logging */
int setup_child(struct sdap_id_ctx *ctx);
+void sdap_gsh_disconnect_callback(void *pvt);
#endif /* _LDAP_COMMON_H_ */
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 917ece0cb..df2956ec6 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -89,6 +89,13 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
goto done;
}
+ ret = be_add_offline_cb(ctx, bectx, sdap_gsh_disconnect_callback, ctx,
+ NULL);
+ if (ret != EOK) {
+ DEBUG(1, ("be_add_offline_cb failed.\n"));
+ goto done;
+ }
+
ret = sdap_id_setup_tasks(ctx);
if (ret != EOK) {
goto done;