1 The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
2 example if libldap needs to be initialized from within gethostbyXXXX() (which
3 actually happens if nss_ldap is used for hostname resolution and earlier
4 modules can't resolve the local host name), so use the reentrant versions of
5 the functions, even if we're not being compiled for use in libldap_r (patch
6 from Jeffery Layton, #179730).
7 --- openldap-2.3.19/libraries/libldap/util-int.c 2006-02-23 15:42:14.000000000 -0500
8 +++ openldap-2.3.19/libraries/libldap/util-int.c 2006-02-23 15:42:02.000000000 -0500
10 #ifndef LDAP_R_COMPILE
11 # undef HAVE_REENTRANT_FUNCTIONS
13 -# undef HAVE_GETHOSTBYNAME_R
14 -# undef HAVE_GETHOSTBYADDR_R
15 +/* # undef HAVE_GETHOSTBYNAME_R */
16 +/* # undef HAVE_GETHOSTBYADDR_R */
19 # include <ldap_pvt_thread.h>
21 #define BUFSTART (1024-32)
22 #define BUFMAX (32*1024-32)
24 -#if defined(LDAP_R_COMPILE)
25 +#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
26 static char *safe_realloc( char **buf, int len );
28 #if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))