diff --git a/bind-dyndb-ldap-reconnection.patch b/bind-dyndb-ldap-reconnection.patch new file mode 100644 index 0000000..fee7e52 --- /dev/null +++ b/bind-dyndb-ldap-reconnection.patch @@ -0,0 +1,31 @@ +diff -up bind-dyndb-ldap-0.1.0a1/src/ldap_helper.c.reconnection bind-dyndb-ldap-0.1.0a1/src/ldap_helper.c +--- bind-dyndb-ldap-0.1.0a1/src/ldap_helper.c.reconnection 2009-09-04 14:45:52.088622308 +0200 ++++ bind-dyndb-ldap-0.1.0a1/src/ldap_helper.c 2009-09-04 14:55:25.643684393 +0200 +@@ -1521,10 +1521,11 @@ ldap_connect(ldap_instance_t *ldap_inst) + LDAP_OPT_CHECK(ret, "failed to set timeout: %s", ldap_err2string(ret)); + */ + ++ if (ldap_inst->handle != NULL) ++ ldap_unbind_ext_s(ldap_inst->handle, NULL, NULL); + ldap_inst->handle = ld; +- ldap_reconnect(ldap_inst); + +- return ISC_R_SUCCESS; ++ return ldap_reconnect(ldap_inst); + + cleanup: + +@@ -1636,11 +1637,10 @@ handle_connection_error(ldap_instance_t + *result = ISC_R_SUCCESS; + ldap_inst->tries = 0; + return 0; +- } else if (err_code == LDAP_SERVER_DOWN) { ++ } else if (err_code == LDAP_SERVER_DOWN || err_code == LDAP_CONNECT_ERROR) { + if (ldap_inst->tries == 0) + log_error("connection to the LDAP server was lost"); +- *result = ldap_reconnect(ldap_inst); +- if (*result == ISC_R_SUCCESS) ++ if (ldap_connect(ldap_inst) == ISC_R_SUCCESS) + return 1; + } else { + err_string = ldap_err2string(err_code); diff --git a/bind-dyndb-ldap.spec b/bind-dyndb-ldap.spec index b4a9f0d..4a6dccd 100644 --- a/bind-dyndb-ldap.spec +++ b/bind-dyndb-ldap.spec @@ -1,6 +1,6 @@ Name: bind-dyndb-ldap Version: 0.1.0 -Release: 0.3.a1%{?dist} +Release: 0.4.a1%{?dist} Summary: LDAP back-end plug-in for BIND Group: System Environment/Libraries @@ -14,6 +14,7 @@ BuildRequires: openldap-devel Requires: bind >= 9.6.1-0.3.b1 Patch0: bind-dyndb-ldap-bool_case.patch +Patch1: bind-dyndb-ldap-reconnection.patch %description This package provides an LDAP back-end plug-in for BIND. It features @@ -25,6 +26,7 @@ off of your LDAP server. %setup -q -n %{name}-%{version}a1 %patch0 -p1 -b .bool_case +%patch1 -p1 -b .reconnection %build @@ -52,6 +54,9 @@ rm -rf %{buildroot} %changelog +* Fri Sep 04 2009 Martin Nagy - 0.1.0-0.4.a1 +- fix reconnection to the LDAP server + * Mon Aug 31 2009 Martin Nagy - 0.1.0-0.3.a1 - Use uppercase boolean values (#520256)