Blame SOURCES/openldap-reentrant-gethostby.patch

57672d
The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
57672d
example if libldap needs to be initialized from within gethostbyXXXX() (which
57672d
actually happens if nss_ldap is used for hostname resolution and earlier
57672d
modules can't resolve the local host name), so use the reentrant versions of
57672d
the functions, even if we're not being compiled for use in libldap_r
57672d
57672d
Resolves: #179730
57672d
Author: Jeffery Layton <jlayton@redhat.com>
57672d
57672d
diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c
57672d
index 373c81c..a012062 100644
57672d
--- a/libraries/libldap/util-int.c
57672d
+++ b/libraries/libldap/util-int.c
57672d
@@ -52,8 +52,8 @@ extern int h_errno;
57672d
 #ifndef LDAP_R_COMPILE
57672d
 # undef HAVE_REENTRANT_FUNCTIONS
57672d
 # undef HAVE_CTIME_R
57672d
-# undef HAVE_GETHOSTBYNAME_R
57672d
-# undef HAVE_GETHOSTBYADDR_R
57672d
+/* # undef HAVE_GETHOSTBYNAME_R */
57672d
+/* # undef HAVE_GETHOSTBYADDR_R */
57672d
 
57672d
 #else
57672d
 # include <ldap_pvt_thread.h>
57672d
@@ -317,7 +317,7 @@ ldap_pvt_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
57672d
 #define BUFSTART (1024-32)
57672d
 #define BUFMAX (32*1024-32)
57672d
 
57672d
-#if defined(LDAP_R_COMPILE)
57672d
+#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
57672d
 static char *safe_realloc( char **buf, int len );
57672d
 
57672d
 #if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))