tstellar / rpms / openldap

Forked from rpms/openldap 3 years ago
Clone
b944bc0
The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
b944bc0
example if libldap needs to be initialized from within gethostbyXXXX() (which
b944bc0
actually happens if nss_ldap is used for hostname resolution and earlier
b944bc0
modules can't resolve the local host name), so use the reentrant versions of
b944bc0
the functions, even if we're not being compiled for use in libldap_r (patch
b944bc0
from Jeffery Layton, #179730).
b944bc0
--- openldap-2.3.19/libraries/libldap/util-int.c	2006-02-23 15:42:14.000000000 -0500
b944bc0
+++ openldap-2.3.19/libraries/libldap/util-int.c	2006-02-23 15:42:02.000000000 -0500
b944bc0
@@ -52,8 +52,8 @@
b944bc0
 #ifndef LDAP_R_COMPILE
b944bc0
 # undef HAVE_REENTRANT_FUNCTIONS
b944bc0
 # undef HAVE_CTIME_R
b944bc0
-# undef HAVE_GETHOSTBYNAME_R
b944bc0
-# undef HAVE_GETHOSTBYADDR_R
b944bc0
+/* # undef HAVE_GETHOSTBYNAME_R */
b944bc0
+/* # undef HAVE_GETHOSTBYADDR_R */
b944bc0
 
b944bc0
 #else
b944bc0
 # include <ldap_pvt_thread.h>
b944bc0
@@ -110,7 +110,7 @@
b944bc0
 #define BUFSTART (1024-32)
b944bc0
 #define BUFMAX (32*1024-32)
b944bc0
 
b944bc0
-#if defined(LDAP_R_COMPILE)
b944bc0
+#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
b944bc0
 static char *safe_realloc( char **buf, int len );
b944bc0
 
b944bc0
 #if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))