From: Andreas Schneider Date: Thu, 21 Jul 2022 12:55:31 +0000 (+0200) Subject: third_party: Update socket_wrapper to version 1.3.4 X-Git-Tag: tevent-0.13.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dcb49bbd80abf6f3f082ef9c1d5452991c74c87;p=thirdparty%2Fsamba.git third_party: Update socket_wrapper to version 1.3.4 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/buildtools/wafsamba/samba_third_party.py b/buildtools/wafsamba/samba_third_party.py index 1868e7ba51b..c83fdcf795b 100644 --- a/buildtools/wafsamba/samba_third_party.py +++ b/buildtools/wafsamba/samba_third_party.py @@ -24,7 +24,7 @@ Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA @conf def CHECK_SOCKET_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.3.3') + return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.3.4') Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER @conf diff --git a/third_party/socket_wrapper/socket_wrapper.c b/third_party/socket_wrapper/socket_wrapper.c index 44cfad8c6cf..5804e936ff7 100644 --- a/third_party/socket_wrapper/socket_wrapper.c +++ b/third_party/socket_wrapper/socket_wrapper.c @@ -3815,7 +3815,6 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family) char type; int ret; int port; - struct stat st; char *swrap_dir = NULL; swrap_mutex_lock(&autobind_start_mutex); @@ -3916,10 +3915,12 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family) type, socket_wrapper_default_iface(), port); - if (stat(un_addr.sa.un.sun_path, &st) == 0) continue; ret = libc_bind(fd, &un_addr.sa.s, un_addr.sa_socklen); if (ret == -1) { + if (errno == EALREADY || errno == EADDRINUSE) { + continue; + } goto done; } @@ -6285,9 +6286,11 @@ static void swrap_sendmsg_after(int fd, for (i = 0; i < (size_t)msg->msg_iovlen; i++) { size_t this_time = MIN(remain, (size_t)msg->msg_iov[i].iov_len); - memcpy(buf + ofs, - msg->msg_iov[i].iov_base, - this_time); + if (this_time > 0) { + memcpy(buf + ofs, + msg->msg_iov[i].iov_base, + this_time); + } ofs += this_time; remain -= this_time; } @@ -7849,8 +7852,8 @@ void swrap_destructor(void) * related syscalls also with the '_' prefix. * * This is tested in Samba's 'make test', - * there we noticed that providing '_read' - * and '_open' would cause errors, which + * there we noticed that providing '_read', + * '_open' and '_close' would cause errors, which * means we skip '_read', '_write' and * all non socket related calls without * further analyzing the problem. @@ -7863,7 +7866,6 @@ SWRAP_SYMBOL_ALIAS(accept4, _accept4); #endif SWRAP_SYMBOL_ALIAS(accept, _accept); SWRAP_SYMBOL_ALIAS(bind, _bind); -SWRAP_SYMBOL_ALIAS(close, _close); SWRAP_SYMBOL_ALIAS(connect, _connect); SWRAP_SYMBOL_ALIAS(dup, _dup); SWRAP_SYMBOL_ALIAS(dup2, _dup2); diff --git a/third_party/socket_wrapper/wscript b/third_party/socket_wrapper/wscript index 15ceefd168d..b87072038f8 100644 --- a/third_party/socket_wrapper/wscript +++ b/third_party/socket_wrapper/wscript @@ -2,7 +2,7 @@ import os -VERSION="1.3.3" +VERSION="1.3.4" def configure(conf): if conf.CHECK_SOCKET_WRAPPER():