From 7bfc287b693d3696bd5b3c60bdb7e543eb230f9b Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 7 Jun 2010 15:59:26 -0400 Subject: 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. --- src/providers/ldap/sdap_fd_events.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/providers/ldap/sdap_fd_events.c') diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c index 32782963..f989c224 100644 --- a/src/providers/ldap/sdap_fd_events.c +++ b/src/providers/ldap/sdap_fd_events.c @@ -47,7 +47,23 @@ int get_fd_from_ldap(LDAP *ldap, int *fd) return EOK; } +int remove_ldap_connection_callbacks(struct sdap_handle *sh) +{ +#ifdef HAVE_LDAP_CONNCB + int ret; + + ret = talloc_free(sh->sdap_fd_events->conncb); + if (ret != 0) { + return EIO; + } + + sh->sdap_fd_events->conncb = NULL; +#endif + return EOK; +} + #ifdef HAVE_LDAP_CONNCB + static int remove_connection_callback(TALLOC_CTX *mem_ctx) { int lret; -- cgit