Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-support / openldap / files / 0004-openlap-reentrant-gethostby.patch
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
5
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
11
12 From STX openldap-reentrant-gethostby.patch
13 ---
14  libraries/libldap/util-int.c | 6 +++---
15  1 file changed, 3 insertions(+), 3 deletions(-)
16
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
24  # undef HAVE_CTIME_R
25 -# undef HAVE_GETHOSTBYNAME_R
26 -# undef HAVE_GETHOSTBYADDR_R
27 +/* # undef HAVE_GETHOSTBYNAME_R */
28 +/* # undef HAVE_GETHOSTBYADDR_R */
29  
30  #else
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)
35  
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 );
39  
40  #if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))
41 -- 
42 2.17.1
43