third_party: Update socket_wrapper to version 1.3.4
authorAndreas Schneider <asn@samba.org>
Thu, 21 Jul 2022 12:55:31 +0000 (14:55 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 22 Jul 2022 04:36:30 +0000 (04:36 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
buildtools/wafsamba/samba_third_party.py
third_party/socket_wrapper/socket_wrapper.c
third_party/socket_wrapper/wscript

index 1868e7ba51b3d1ceaa9f31874682276cba122051..c83fdcf795b2d588fafa5d9f2357c2467170fd82 100644 (file)
@@ -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
index 44cfad8c6cfd4790ba82a3a76cc91799a28c7466..5804e936ff791953d040301a7a8106b004cd30ad 100644 (file)
@@ -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);
index 15ceefd168df3c86538f790f8736536fe58c229d..b87072038f849d435cc6871868589b78626b6834 100644 (file)
@@ -2,7 +2,7 @@
 
 import os
 
-VERSION="1.3.3"
+VERSION="1.3.4"
 
 def configure(conf):
     if conf.CHECK_SOCKET_WRAPPER():