From: Andreas Schneider Date: Fri, 5 Jul 2024 11:09:53 +0000 (+0200) Subject: third_party: Update nss_wrapper to version 1.1.16 X-Git-Tag: tdb-1.4.11~174 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a6805cc8235ef081f92ad9b6efaab6cbe02bd0d;p=thirdparty%2Fsamba.git third_party: Update nss_wrapper to version 1.1.16 Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Mon Jul 8 06:28:47 UTC 2024 on atb-devel-224 --- diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py index a42bb2ddc90..96484893b2f 100644 --- a/buildtools/wafsamba/samba_third_party.py +++ b/buildtools/wafsamba/samba_third_party.py @@ -29,7 +29,7 @@ Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER @conf def CHECK_NSS_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.15') + return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.16') Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER @conf diff --git a/third_party/nss_wrapper/nss_wrapper.c b/third_party/nss_wrapper/nss_wrapper.c index 3399f06412a..770d0cf5ddd 100644 --- a/third_party/nss_wrapper/nss_wrapper.c +++ b/third_party/nss_wrapper/nss_wrapper.c @@ -61,6 +61,10 @@ #include #include +#ifdef HAVE_GNU_LIB_NAMES_H +#include +#endif + #include "nss_utils.h" /* * Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h gives us @@ -1156,6 +1160,13 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib) case NWRAP_LIBNSL: #ifdef HAVE_LIBNSL handle = nwrap_main_global->libc->nsl_handle; +#ifdef LIBNSL_SO + if (handle == NULL) { + handle = dlopen(LIBNSL_SO, flags); + + nwrap_main_global->libc->nsl_handle = handle; + } +#endif if (handle == NULL) { for (i = 10; i >= 0; i--) { char soname[256] = {0}; @@ -1193,6 +1204,13 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib) /* FALL TROUGH */ case NWRAP_LIBC: handle = nwrap_main_global->libc->handle; +#ifdef LIBC_SO + if (handle == NULL) { + handle = dlopen(LIBC_SO, flags); + + nwrap_main_global->libc->handle = handle; + } +#endif if (handle == NULL) { for (i = 10; i >= 0; i--) { char soname[256] = {0}; @@ -2422,6 +2440,13 @@ static bool nwrap_pw_parse_line(struct nwrap_cache *nwrap, char *line) return false; } *p = '\0'; +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + /* + * We don't support pw_class, so just let it point to + * an '\0' byte (empty string). + */ + pw->pw_class = p; +#endif /* HAVE_STRUCT_PASSWD_PW_CLASS */ p++; e = NULL; pw->pw_gid = (gid_t)strtoul(c, &e, 10); @@ -2448,8 +2473,6 @@ static bool nwrap_pw_parse_line(struct nwrap_cache *nwrap, char *line) NWRAP_LOG(NWRAP_LOG_TRACE, "gid[%u]\n", pw->pw_gid); #ifdef HAVE_STRUCT_PASSWD_PW_CLASS - pw->pw_class = discard_const_p(char, ""); - NWRAP_LOG(NWRAP_LOG_TRACE, "class[%s]", pw->pw_class); #endif /* HAVE_STRUCT_PASSWD_PW_CLASS */ @@ -6531,7 +6554,7 @@ void nwrap_destructor(void) } SAFE_FREE(nwrap_gr_global.list); - nwrap_pw_global.num = 0; + nwrap_gr_global.num = 0; } #if defined(HAVE_SHADOW_H) && defined(HAVE_GETSPNAM) diff --git a/third_party/nss_wrapper/wscript b/third_party/nss_wrapper/wscript index 28aeb510719..a8228a006cc 100644 --- a/third_party/nss_wrapper/wscript +++ b/third_party/nss_wrapper/wscript @@ -2,7 +2,7 @@ import os -VERSION="1.1.15" +VERSION="1.1.16" def configure(conf): if conf.CHECK_NSS_WRAPPER(): @@ -10,6 +10,7 @@ def configure(conf): libnss_wrapper_so_path = 'libnss_wrapper.so' else: conf.CHECK_HEADERS('nss.h') + conf.CHECK_HEADERS('gnu/lib-names.h') if conf.CONFIG_SET("HAVE___THREAD"): conf.DEFINE("HAVE_GCC_THREAD_LOCAL_STORAGE", 1)