summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_common.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-06-07 15:59:26 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-06-09 08:29:47 -0400
commit48c3ce82e0c0fc061e00cb7ddf4f145dfd465edc (patch)
treea8a33a2edd7f9ce9ef0c92f0e6dbc3708494a600 /src/providers/ldap/ldap_common.c
parent83aa1c2629eb7600dd2b6b207daa709a333e2720 (diff)
downloadsssd-48c3ce82e0c0fc061e00cb7ddf4f145dfd465edc.tar.gz
sssd-48c3ce82e0c0fc061e00cb7ddf4f145dfd465edc.tar.xz
sssd-48c3ce82e0c0fc061e00cb7ddf4f145dfd465edc.zip
Disable connection callbacks when going online
Under certain circumstances, the openldap libraries will continue internally trying to reconnect to a connection lost (as during a cable-pull test). We need to drop the reconnection callbacks when marking the backend offline in order to guarantee that they are not called with an invalid sdap_handle.
Diffstat (limited to 'src/providers/ldap/ldap_common.c')
-rw-r--r--src/providers/ldap/ldap_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 0257ef638..78bcac2db 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -24,6 +24,7 @@
#include "providers/ldap/ldap_common.h"
#include "providers/fail_over.h"
+#include "providers/ldap/sdap_async_private.h"
#include "util/sss_krb5.h"
@@ -358,10 +359,19 @@ bool sdap_connected(struct sdap_id_ctx *ctx)
void sdap_mark_offline(struct sdap_id_ctx *ctx)
{
+ int ret;
+
if (ctx->gsh) {
/* make sure we mark the connection as gone when we go offline so that
* we do not try to reuse a bad connection by mistale later */
ctx->gsh->connected = false;
+ ret = remove_ldap_connection_callbacks(ctx->gsh);
+ if (ret != EOK) {
+ DEBUG(1, ("Could not clear ldap connection callbacks\n"));
+ /* Not really anything we can do about this, so proceed
+ * and hope for the best.
+ */
+ }
}
be_mark_offline(ctx->be);