third_party: Update nss_wraper to version 1.1.12
authorAndreas Schneider <asn@samba.org>
Fri, 24 Jun 2022 08:39:57 +0000 (10:39 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 24 Jun 2022 22:29:33 +0000 (22:29 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 24 22:29:33 UTC 2022 on sn-devel-184

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

index f046ebc96da353631c3889f04f42d3b48ac1b2c8..1868e7ba51b3d1ceaa9f31874682276cba122051 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.11')
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('nss_wrapper', minversion='1.1.12')
 Build.BuildContext.CHECK_NSS_WRAPPER = CHECK_NSS_WRAPPER
 
 @conf
index 17c87321d4d5dbd9c7547a29e5ab5872afacd0be..88e81d9c652bb87d02daa87ba73e6f27f8894adc 100644 (file)
@@ -1070,7 +1070,14 @@ static struct nwrap_he nwrap_he_global;
 
 static bool nwrap_gr_parse_line(struct nwrap_cache *nwrap, char *line);
 static void nwrap_gr_unload(struct nwrap_cache *nwrap);
+#if ! defined(HAVE_CONSTRUCTOR_ATTRIBUTE) && defined(HAVE_PRAGMA_INIT)
+/* xlC and other oldschool compilers support (only) this */
+#pragma init (nwrap_constructor)
+#endif
 void nwrap_constructor(void) CONSTRUCTOR_ATTRIBUTE;
+#if ! defined(HAVE_DESTRUCTOR_ATTRIBUTE) && defined(HAVE_PRAGMA_FINI)
+#pragma fini (nwrap_destructor)
+#endif
 void nwrap_destructor(void) DESTRUCTOR_ATTRIBUTE;
 
 /*********************************************************
@@ -2129,7 +2136,21 @@ reopen:
        }
 
        ret = fstat(nwrap->fd, &st);
-       if (ret != 0) {
+       if (ret != 0 && errno == EBADF && retried == false) {
+               /* maybe something closed the fd on our behalf */
+               NWRAP_LOG(NWRAP_LOG_TRACE,
+                         "fstat(%s) - %d:%s - reopen",
+                         nwrap->path,
+                         ret,
+                         strerror(errno));
+               retried = true;
+               memset(&nwrap->st, 0, sizeof(nwrap->st));
+               fclose(nwrap->fp);
+               nwrap->fp = NULL;
+               nwrap->fd = -1;
+               goto reopen;
+       }
+       else if (ret != 0) {
                NWRAP_LOG(NWRAP_LOG_ERROR,
                          "fstat(%s) - %d:%s",
                          nwrap->path,
@@ -4070,6 +4091,10 @@ static int nwrap_files_getaddrinfo(const char *name,
        }
 
        name_len = strlen(name);
+       if (name_len == 0) {
+               return EAI_NONAME;
+       }
+
        if (name_len < sizeof(canon_name) && name[name_len - 1] == '.') {
                memcpy(canon_name, name, name_len - 1);
                canon_name[name_len] = '\0';
@@ -4462,7 +4487,7 @@ static int nwrap_module_getpwent_r(struct nwrap_backend *b,
 
 static void nwrap_module_endpwent(struct nwrap_backend *b)
 {
-       if (b->symbols->_nss_endpwent.f) {
+       if (b->symbols->_nss_endpwent.f == NULL) {
                return;
        }
 
@@ -4634,7 +4659,7 @@ static int nwrap_module_getgrgid_r(struct nwrap_backend *b,
 
 static void nwrap_module_setgrent(struct nwrap_backend *b)
 {
-       if (b->symbols->_nss_setgrent.f) {
+       if (b->symbols->_nss_setgrent.f == NULL) {
                return;
        }
 
index 0728d4fee7c308acf5bf4bba889211b22375f1c1..c9f0b9a1edd0435c8ac40c4104ad44a9d75b24ae 100644 (file)
@@ -2,7 +2,7 @@
 
 import os
 
-VERSION="1.1.11"
+VERSION="1.1.12"
 
 def configure(conf):
     if conf.CHECK_NSS_WRAPPER():