Skip to content

Commit

Permalink
third_party: Update socket_wrapper to version 1.3.4
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
cryptomilk authored and jrasamba committed Jul 22, 2022
1 parent 1a897f1 commit 5dcb49b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion buildtools/wafsamba/samba_third_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def CHECK_CMOCKA(conf):

@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
Expand Down
18 changes: 10 additions & 8 deletions third_party/socket_wrapper/socket_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion third_party/socket_wrapper/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

VERSION="1.3.3"
VERSION="1.3.4"

def configure(conf):
if conf.CHECK_SOCKET_WRAPPER():
Expand Down

0 comments on commit 5dcb49b

Please sign in to comment.