]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
third_party: Update nss_wrapper to version 1.1.16
authorAndreas Schneider <asn@samba.org>
Fri, 5 Jul 2024 11:09:53 +0000 (13:09 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 8 Jul 2024 06:28:47 +0000 (06:28 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul  8 06:28:47 UTC 2024 on atb-devel-224

buildtools/wafsamba/samba_third_party.py
third_party/nss_wrapper/nss_wrapper.c
third_party/nss_wrapper/wscript

index a42bb2ddc901df74771aa12b37a863871ed7fd69..96484893b2f533e78a2be2d7dd8d1d00767c89eb 100644 (file)
@@ -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
index 3399f06412a2e03b2e1c70f40d6ed2b588cf6e8e..770d0cf5dddb3c2dff6f8424d1dca702cbf68c2a 100644 (file)
 #include <search.h>
 #include <assert.h>
 
+#ifdef HAVE_GNU_LIB_NAMES_H
+#include <gnu/lib-names.h>
+#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)
index 28aeb51071982b0f0d98a97b4d19e55505fd080d..a8228a006cc98177957e80e896a8cd0d94b22496 100644 (file)
@@ -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)