summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2010-10-04 16:35:50 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-10-08 19:51:16 -0400
commit9eec33b0ec3f1ecf1928b71bf9481c2ab2378971 (patch)
tree660c13e343cf4660d509cad98f03a05e5afedc83
parent21df9f2a3fc890db98bcaa9b93f9398d723d01dd (diff)
downloadsssd-9eec33b0ec3f1ecf1928b71bf9481c2ab2378971.tar.gz
sssd-9eec33b0ec3f1ecf1928b71bf9481c2ab2378971.tar.xz
sssd-9eec33b0ec3f1ecf1928b71bf9481c2ab2378971.zip
Disable events on ldap fd when offline.
Erase events on LDAP socket when backend is offline and an event appears on the socket. Normally this would lead to infinite loop, because event is present on the fd, but instead of being processed, an error log is written and the program continues to wait for the event. Ticket: #599
-rw-r--r--src/providers/ldap/sdap_fd_events.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c
index 347cf8b81..c3f9e118b 100644
--- a/src/providers/ldap/sdap_fd_events.c
+++ b/src/providers/ldap/sdap_fd_events.c
@@ -49,14 +49,16 @@ int get_fd_from_ldap(LDAP *ldap, int *fd)
int remove_ldap_connection_callbacks(struct sdap_handle *sh)
{
-#ifdef HAVE_LDAP_CONNCB
/* sdap_fd_events might be NULL here if sdap_mark_offline()
* was called before a connection was established.
*/
if (sh->sdap_fd_events) {
+#ifdef HAVE_LDAP_CONNCB
talloc_zfree(sh->sdap_fd_events->conncb);
- }
+#else
+ talloc_zfree(sh->sdap_fd_events->fde);
#endif
+ }
return EOK;
}