1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-20 17:44:21 +03:00

third_party: Update socket_wrapper to version 1.3.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andreas Schneider
2022-07-21 14:55:31 +02:00
committed by Jeremy Allison
parent 1a897f1b71
commit 5dcb49bbd8
3 changed files with 12 additions and 10 deletions

View File

@@ -24,7 +24,7 @@ Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
@conf @conf
def CHECK_SOCKET_WRAPPER(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 Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
@conf @conf

View File

@@ -3815,7 +3815,6 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family)
char type; char type;
int ret; int ret;
int port; int port;
struct stat st;
char *swrap_dir = NULL; char *swrap_dir = NULL;
swrap_mutex_lock(&autobind_start_mutex); swrap_mutex_lock(&autobind_start_mutex);
@@ -3916,10 +3915,12 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family)
type, type,
socket_wrapper_default_iface(), socket_wrapper_default_iface(),
port); port);
if (stat(un_addr.sa.un.sun_path, &st) == 0) continue;
ret = libc_bind(fd, &un_addr.sa.s, un_addr.sa_socklen); ret = libc_bind(fd, &un_addr.sa.s, un_addr.sa_socklen);
if (ret == -1) { if (ret == -1) {
if (errno == EALREADY || errno == EADDRINUSE) {
continue;
}
goto done; goto done;
} }
@@ -6285,9 +6286,11 @@ static void swrap_sendmsg_after(int fd,
for (i = 0; i < (size_t)msg->msg_iovlen; i++) { for (i = 0; i < (size_t)msg->msg_iovlen; i++) {
size_t this_time = MIN(remain, (size_t)msg->msg_iov[i].iov_len); size_t this_time = MIN(remain, (size_t)msg->msg_iov[i].iov_len);
memcpy(buf + ofs, if (this_time > 0) {
msg->msg_iov[i].iov_base, memcpy(buf + ofs,
this_time); msg->msg_iov[i].iov_base,
this_time);
}
ofs += this_time; ofs += this_time;
remain -= this_time; remain -= this_time;
} }
@@ -7849,8 +7852,8 @@ void swrap_destructor(void)
* related syscalls also with the '_' prefix. * related syscalls also with the '_' prefix.
* *
* This is tested in Samba's 'make test', * This is tested in Samba's 'make test',
* there we noticed that providing '_read' * there we noticed that providing '_read',
* and '_open' would cause errors, which * '_open' and '_close' would cause errors, which
* means we skip '_read', '_write' and * means we skip '_read', '_write' and
* all non socket related calls without * all non socket related calls without
* further analyzing the problem. * further analyzing the problem.
@@ -7863,7 +7866,6 @@ SWRAP_SYMBOL_ALIAS(accept4, _accept4);
#endif #endif
SWRAP_SYMBOL_ALIAS(accept, _accept); SWRAP_SYMBOL_ALIAS(accept, _accept);
SWRAP_SYMBOL_ALIAS(bind, _bind); SWRAP_SYMBOL_ALIAS(bind, _bind);
SWRAP_SYMBOL_ALIAS(close, _close);
SWRAP_SYMBOL_ALIAS(connect, _connect); SWRAP_SYMBOL_ALIAS(connect, _connect);
SWRAP_SYMBOL_ALIAS(dup, _dup); SWRAP_SYMBOL_ALIAS(dup, _dup);
SWRAP_SYMBOL_ALIAS(dup2, _dup2); SWRAP_SYMBOL_ALIAS(dup2, _dup2);

View File

@@ -2,7 +2,7 @@
import os import os
VERSION="1.3.3" VERSION="1.3.4"
def configure(conf): def configure(conf):
if conf.CHECK_SOCKET_WRAPPER(): if conf.CHECK_SOCKET_WRAPPER():