rpms/sssd/F-13 0001-Disable-connection-callbacks-when-going-online.patch, NONE, 1.1 sssd.spec, 1.44, 1.45

Stephen Gallagher sgallagh at fedoraproject.org
Thu Jun 17 11:25:44 UTC 2010


Author: sgallagh

Update of /cvs/pkgs/rpms/sssd/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv9785

Modified Files:
	sssd.spec 
Added Files:
	0001-Disable-connection-callbacks-when-going-online.patch 
Log Message:
* Thu Jun 17 2010 Stephen Gallagher <sgallagh at redhat.com> - 1.2.1-13
- Eliminate tight loop when reconnecting to LDAP - rhbz#604961


0001-Disable-connection-callbacks-when-going-online.patch:
 ldap_common.c        |   10 ++++++++++
 sdap_async_private.h |    1 +
 sdap_fd_events.c     |   17 ++++++++++++++++-
 3 files changed, 27 insertions(+), 1 deletion(-)

--- NEW FILE 0001-Disable-connection-callbacks-when-going-online.patch ---
>From 48c3ce82e0c0fc061e00cb7ddf4f145dfd465edc Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh at redhat.com>
Date: Mon, 7 Jun 2010 15:59:26 -0400
Subject: [PATCH] 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/ldap_common.c        |   10 ++++++++++
 src/providers/ldap/sdap_async_private.h |    1 +
 src/providers/ldap/sdap_fd_events.c     |   16 ++++++++++++++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 0257ef63850982fcf8334c09fb6f278b735a9ad8..78bcac2dbbd5b5ab469dc7cea49e005045f06ce1 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);
diff --git a/src/providers/ldap/sdap_async_private.h b/src/providers/ldap/sdap_async_private.h
index 727cee2e0e87e5efa0340d3a94d1589022f6676c..ac91a0105f517116d0012711caf5e271038750d6 100644
--- a/src/providers/ldap/sdap_async_private.h
+++ b/src/providers/ldap/sdap_async_private.h
@@ -33,6 +33,7 @@ void sdap_ldap_result(struct tevent_context *ev, struct tevent_fd *fde,
 
 int setup_ldap_connection_callbacks(struct sdap_handle *sh,
                                     struct tevent_context *ev);
+int remove_ldap_connection_callbacks(struct sdap_handle *sh);
 
 int get_fd_from_ldap(LDAP *ldap, int *fd);
 
diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c
index 3278296308fcb1a745dbd4cb89a4cc0c05aa065b..f989c2249900a75bf2c56fb2ded649ae877cca78 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;
-- 
1.7.0.1



Index: sssd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/sssd/F-13/sssd.spec,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- sssd.spec	24 May 2010 21:14:53 -0000	1.44
+++ sssd.spec	17 Jun 2010 11:25:44 -0000	1.45
@@ -7,7 +7,7 @@ Name: sssd
 Version: 1.2.0
 #Never reset the Release, always increment it
 #Otherwise we can have issues if library versions do not change
-Release: 12%{?dist}
+Release: 13%{?dist}
 Group: Applications/System
 Summary: System Security Services Daemon
 License: GPLv3+
@@ -23,6 +23,8 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{na
 
 ### Patches ###
 
+Patch0001: 0001-Disable-connection-callbacks-when-going-online.patch
+
 ### Dependencies ###
 
 Requires: libldb >= 0.9.3
@@ -200,6 +202,7 @@ A dynamically-growing, reference-counted
 
 %prep
 %setup -q
+%patch0001 -p1
 
 %build
 %configure \
@@ -453,6 +456,9 @@ fi
 %postun -n libref_array -p /sbin/ldconfig
 
 %changelog
+* Thu Jun 17 2010 Stephen Gallagher <sgallagh at redhat.com> - 1.2.1-13
+- Eliminate tight loop when reconnecting to LDAP - rhbz#604961
+
 * Mon May 24 2010 Stephen Gallagher <sgallagh at redhat.com> - 1.2.0-12
 - New stable upstream version 1.2.0
 - Support ServiceGroups for FreeIPA v2 HBAC rules



More information about the scm-commits mailing list