Blame SOURCES/autofs-5.0.8-fix-deadlock-in-init-ldap-connection.patch

306fa1
Fix deadlock in init_ldap_connection()
306fa1
306fa1
From: Leonardo Chiquitto <leonardo.lists@gmail.com>
306fa1
306fa1
Commit 9fc20db13 ("fix crash due to thread unsafe use of libldap")
306fa1
introduced a deadlock in init_ldap_connection(). When TLS is on,
306fa1
this function will call itself recursively and try to lock a mutex
306fa1
that's already owned by the thread. Fix the problem by using the
306fa1
lockless version.
306fa1
---
306fa1
 CHANGELOG             |    1 +
306fa1
 modules/lookup_ldap.c |    2 +-
306fa1
 2 files changed, 2 insertions(+), 1 deletion(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -106,6 +106,7 @@
306fa1
 - fix mistake in assignment.
306fa1
 - use open(2) instead of access(2) to trigger dependent mounts.
306fa1
 - fix crash due to thread unsafe use of libldap.
306fa1
+- fix deadlock in init_ldap_connection.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/lookup_ldap.c
306fa1
+++ autofs-5.0.7/modules/lookup_ldap.c
306fa1
@@ -288,7 +288,7 @@ LDAP *__init_ldap_connection(unsigned lo
306fa1
 				return NULL;
306fa1
 			}
306fa1
 			ctxt->use_tls = LDAP_TLS_DONT_USE;
306fa1
-			ldap = init_ldap_connection(logopt, uri, ctxt);
306fa1
+			ldap = __init_ldap_connection(logopt, uri, ctxt);
306fa1
 			if (ldap)
306fa1
 				ctxt->use_tls = LDAP_TLS_INIT;
306fa1
 			return ldap;