summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2022-06-24 10:39:57 +0200
committerJeremy Allison <jra@samba.org>2022-06-24 22:29:33 +0000
commitcd09d4f470f9b910a426e9bbc1931b68d78e1bd6 (patch)
tree32ef9d27d849c2d3f7ae8f6268d26ca24b11040c /third_party
parent80ba66013efeec2f2df8429321a8630ef7780a8f (diff)
downloadsamba-cd09d4f470f9b910a426e9bbc1931b68d78e1bd6.tar.gz
third_party: Update nss_wraper to version 1.1.12
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
Diffstat (limited to 'third_party')
-rw-r--r--third_party/nss_wrapper/nss_wrapper.c31
-rw-r--r--third_party/nss_wrapper/wscript2
2 files changed, 29 insertions, 4 deletions
diff --git a/third_party/nss_wrapper/nss_wrapper.c b/third_party/nss_wrapper/nss_wrapper.c
index 17c87321d4d..88e81d9c652 100644
--- a/third_party/nss_wrapper/nss_wrapper.c
+++ b/third_party/nss_wrapper/nss_wrapper.c
@@ -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;
}
diff --git a/third_party/nss_wrapper/wscript b/third_party/nss_wrapper/wscript
index 0728d4fee7c..c9f0b9a1edd 100644
--- a/third_party/nss_wrapper/wscript
+++ b/third_party/nss_wrapper/wscript
@@ -2,7 +2,7 @@
import os
-VERSION="1.1.11"
+VERSION="1.1.12"
def configure(conf):
if conf.CHECK_NSS_WRAPPER():