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