1 From df22708bcbe727570daada3fbf8065a447444716 Mon Sep 17 00:00:00 2001
2 From: babak sarashki <babak.sarashki@windriver.com>
3 Date: Sun, 3 Nov 2019 14:34:19 -0800
4 Subject: [PATCH 04/20] openlap reentrant gethostby
6 The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
7 example if libldap needs to be initialized from within gethostbyXXXX() (which
8 actually happens if nss_ldap is used for hostname resolution and earlier
9 modules can't resolve the local host name), so use the reentrant versions of
10 the functions, even if we're not being compiled for use in libldap_r
12 From STX openldap-reentrant-gethostby.patch
14 libraries/libldap/util-int.c | 6 +++---
15 1 file changed, 3 insertions(+), 3 deletions(-)
17 diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c
18 index e65db0c..0628951 100644
19 --- a/libraries/libldap/util-int.c
20 +++ b/libraries/libldap/util-int.c
21 @@ -52,8 +52,8 @@ extern int h_errno;
22 #ifndef LDAP_R_COMPILE
23 # undef HAVE_REENTRANT_FUNCTIONS
25 -# undef HAVE_GETHOSTBYNAME_R
26 -# undef HAVE_GETHOSTBYADDR_R
27 +/* # undef HAVE_GETHOSTBYNAME_R */
28 +/* # undef HAVE_GETHOSTBYADDR_R */
31 # include <ldap_pvt_thread.h>
32 @@ -420,7 +420,7 @@ ldap_pvt_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
33 #define BUFSTART (1024-32)
34 #define BUFMAX (32*1024-32)
36 -#if defined(LDAP_R_COMPILE)
37 +#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
38 static char *safe_realloc( char **buf, int len );
40 #if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))