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