|
|
5fcfe9 |
The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
|
|
|
5fcfe9 |
example if libldap needs to be initialized from within gethostbyXXXX() (which
|
|
|
5fcfe9 |
actually happens if nss_ldap is used for hostname resolution and earlier
|
|
|
5fcfe9 |
modules can't resolve the local host name), so use the reentrant versions of
|
|
|
5fcfe9 |
the functions, even if we're not being compiled for use in libldap_r (patch
|
|
|
5fcfe9 |
from Jeffery Layton, #179730).
|
|
|
5fcfe9 |
diff -up openldap-2.4.11/libraries/libldap/util-int.c.patch7 openldap-2.4.11/libraries/libldap/util-int.c
|
|
|
5fcfe9 |
--- openldap-2.4.11/libraries/libldap/util-int.c.patch7 2008-02-12 00:26:41.000000000 +0100
|
|
|
5fcfe9 |
+++ openldap-2.4.11/libraries/libldap/util-int.c 2008-09-01 09:57:09.000000000 +0200
|
|
|
5fcfe9 |
@@ -52,8 +52,8 @@ extern int h_errno;
|
|
|
5fcfe9 |
#ifndef LDAP_R_COMPILE
|
|
|
5fcfe9 |
# undef HAVE_REENTRANT_FUNCTIONS
|
|
|
5fcfe9 |
# undef HAVE_CTIME_R
|
|
|
5fcfe9 |
-# undef HAVE_GETHOSTBYNAME_R
|
|
|
5fcfe9 |
-# undef HAVE_GETHOSTBYADDR_R
|
|
|
5fcfe9 |
+/* # undef HAVE_GETHOSTBYNAME_R */
|
|
|
5fcfe9 |
+/* # undef HAVE_GETHOSTBYADDR_R */
|
|
|
5fcfe9 |
|
|
|
5fcfe9 |
#else
|
|
|
5fcfe9 |
# include <ldap_pvt_thread.h>
|
|
|
5fcfe9 |
@@ -110,7 +110,7 @@ char *ldap_pvt_ctime( const time_t *tp,
|
|
|
5fcfe9 |
#define BUFSTART (1024-32)
|
|
|
5fcfe9 |
#define BUFMAX (32*1024-32)
|
|
|
5fcfe9 |
|
|
|
5fcfe9 |
-#if defined(LDAP_R_COMPILE)
|
|
|
5fcfe9 |
+#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
|
|
|
5fcfe9 |
static char *safe_realloc( char **buf, int len );
|
|
|
5fcfe9 |
|
|
|
5fcfe9 |
#if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))
|