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

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