|
|
103552 |
The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
|
|
|
103552 |
example if libldap needs to be initialized from within gethostbyXXXX() (which
|
|
|
103552 |
actually happens if nss_ldap is used for hostname resolution and earlier
|
|
|
103552 |
modules can't resolve the local host name), so use the reentrant versions of
|
|
|
103552 |
the functions, even if we're not being compiled for use in libldap_r
|
|
|
103552 |
|
|
|
103552 |
Resolves: #179730
|
|
|
103552 |
Author: Jeffery Layton <jlayton@redhat.com>
|
|
|
103552 |
|
|
|
103552 |
diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c
|
|
|
103552 |
index 373c81c..a012062 100644
|
|
|
103552 |
--- a/libraries/libldap/util-int.c
|
|
|
103552 |
+++ b/libraries/libldap/util-int.c
|
|
|
103552 |
@@ -52,8 +52,8 @@ extern int h_errno;
|
|
|
103552 |
#ifndef LDAP_R_COMPILE
|
|
|
103552 |
# undef HAVE_REENTRANT_FUNCTIONS
|
|
|
103552 |
# undef HAVE_CTIME_R
|
|
|
103552 |
-# undef HAVE_GETHOSTBYNAME_R
|
|
|
103552 |
-# undef HAVE_GETHOSTBYADDR_R
|
|
|
103552 |
+/* # undef HAVE_GETHOSTBYNAME_R */
|
|
|
103552 |
+/* # undef HAVE_GETHOSTBYADDR_R */
|
|
|
103552 |
|
|
|
103552 |
#else
|
|
|
103552 |
# include <ldap_pvt_thread.h>
|
|
|
103552 |
@@ -317,7 +317,7 @@ ldap_pvt_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
|
|
|
103552 |
#define BUFSTART (1024-32)
|
|
|
103552 |
#define BUFMAX (32*1024-32)
|
|
|
103552 |
|
|
|
103552 |
-#if defined(LDAP_R_COMPILE)
|
|
|
103552 |
+#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
|
|
|
103552 |
static char *safe_realloc( char **buf, int len );
|
|
|
103552 |
|
|
|
103552 |
#if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))
|