The branch, master has been updated
via be007c2cf41 third_party: Update socket_wrapper to version 1.5.1
via 3fa94d9f2fc selftest: mark samba4.rpc.samr.passwords.lockout on
ncacn_np with .samr.lockout as flapping
from 51b7bc61c6f samba-tool: Fix invalid escape sequences
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit be007c2cf41085a8648965fc904f37d25d35a453
Author: Stefan Metzmacher <[email protected]>
Date: Mon May 19 20:37:20 2025 +0200
third_party: Update socket_wrapper to version 1.5.1
Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Ralph Boehme <[email protected]>
Autobuild-User(master): Ralph Böhme <[email protected]>
Autobuild-Date(master): Wed May 28 11:04:40 UTC 2025 on atb-devel-224
commit 3fa94d9f2fcb165d435c62badde9e3c8569ff40d
Author: Ralph Boehme <[email protected]>
Date: Wed May 28 11:18:16 2025 +0200
selftest: mark samba4.rpc.samr.passwords.lockout on ncacn_np with
.samr.lockout as flapping
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Stefan Metzmacher <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
selftest/flapping.d/samba4.rpc.samr.passwords | 1 +
third_party/socket_wrapper/socket_wrapper.c | 97 ++++++++++++++++++++++++++-
2 files changed, 97 insertions(+), 1 deletion(-)
create mode 100644 selftest/flapping.d/samba4.rpc.samr.passwords
Changeset truncated at 500 lines:
diff --git a/selftest/flapping.d/samba4.rpc.samr.passwords
b/selftest/flapping.d/samba4.rpc.samr.passwords
new file mode 100644
index 00000000000..85618be9a08
--- /dev/null
+++ b/selftest/flapping.d/samba4.rpc.samr.passwords
@@ -0,0 +1 @@
+^samba4.rpc.samr.passwords.lockout on ncacn_np with
.samr.lockout\(ad_dc_slowtests\)
diff --git a/third_party/socket_wrapper/socket_wrapper.c
b/third_party/socket_wrapper/socket_wrapper.c
index c4df8ede842..bc4000cb7ed 100644
--- a/third_party/socket_wrapper/socket_wrapper.c
+++ b/third_party/socket_wrapper/socket_wrapper.c
@@ -324,6 +324,7 @@ struct socket_info
*/
int family;
+ int type_flags; /* SOCK_CLOEXEC or SOCK_NONBLOCK */
int type;
int protocol;
int opt_type;
@@ -3804,6 +3805,7 @@ static int swrap_socket(int family, int type, int
protocol, int allow_quic)
/* however, the rest of the socket_wrapper code expects just
* the type, not the flags */
si->type = real_type;
+ si->type_flags = type & ~real_type;
si->protocol = protocol;
si->opt_type = opt_type;
si->opt_protocol = opt_protocol;
@@ -4074,6 +4076,7 @@ static int swrap_accept(int s,
child_si = &new_si;
child_si->family = parent_si->family;
+ child_si->type_flags = parent_si->type_flags;
child_si->type = parent_si->type;
child_si->protocol = parent_si->protocol;
child_si->opt_type = parent_si->opt_type;
@@ -5628,7 +5631,7 @@ static int swrap_sendmsg_filter_cmsg_sol_socket(const
struct cmsghdr *cmsg,
return rc;
}
-static const uint64_t swrap_unix_scm_right_magic = 0x8e0e13f27c42fc37;
+static const uint64_t swrap_unix_scm_right_magic = 0x8e0e13f27c42fc38;
/*
* We only allow up to 6 fds at a time
@@ -6504,6 +6507,90 @@ static ssize_t swrap_recvmsg_after_unix(struct msghdr
*msg_tmp,
#endif /* ! HAVE_STRUCT_MSGHDR_MSG_CONTROL */
}
+static int swrap_protocol_fallback(int fd, struct socket_info *si)
+{
+ const char *env_var = "SOCKET_WRAPPER_ALLOW_DGRAM_SEQPACKET_FALLBACK";
+ const char *env_allow_dgram_seqpacket_fallback = NULL;
+ bool allow_dgram_seqpacket_fallback = false;
+ struct swrap_address un_addr = {
+ .sa_socklen = sizeof(struct sockaddr_un),
+ .sa = {
+ .un = si->un_addr,
+ },
+ };
+ int new_type;
+ int tfd = -1;
+ int rc;
+
+ if (si->is_server) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ if (!si->connected) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ if (si->opt_type != SOCK_DGRAM) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ if (si->opt_protocol != IPPROTO_UDP) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ env_allow_dgram_seqpacket_fallback = getenv(env_var);
+ if (env_allow_dgram_seqpacket_fallback != NULL &&
+ strlen(env_allow_dgram_seqpacket_fallback) >= 1 &&
+ strcmp(env_allow_dgram_seqpacket_fallback, "0") != 0)
+ {
+ allow_dgram_seqpacket_fallback = true;
+ }
+
+ if (!allow_dgram_seqpacket_fallback) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ /*
+ * Change the low level socket to
+ * SOCK_SEQPACKET as the other end
+ * may used IPPROTO_QUIC with SOCK_SEQPACKET.
+ */
+ new_type = SOCK_SEQPACKET | si->type_flags;
+ tfd = libc_socket(AF_UNIX, new_type, 0);
+ if (tfd == -1) {
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ /*
+ * Now rebind the local end
+ */
+ unlink(un_addr.sa.un.sun_path);
+ rc = libc_bind(tfd, &un_addr.sa.s, un_addr.sa_socklen);
+ if (rc == -1) {
+ close(tfd);
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ /*
+ * Now replace the callers known fd.
+ */
+ rc = libc_dup2(tfd, fd);
+ if (rc == -1) {
+ close(tfd);
+ errno = EHOSTUNREACH;
+ return -1;
+ }
+
+ return 0;
+}
+
static ssize_t swrap_sendmsg_before(int fd,
struct socket_info *si,
struct msghdr *msg,
@@ -6643,6 +6730,14 @@ static ssize_t swrap_sendmsg_before(int fd,
ret = libc_connect(fd,
(struct sockaddr *)(void *)tmp_un,
sizeof(*tmp_un));
+ if (ret == -1 && errno == EPROTOTYPE) {
+ ret = swrap_protocol_fallback(fd, si);
+ if (ret == 0) {
+ ret = libc_connect(fd,
+ (struct sockaddr *)(void
*)tmp_un,
+ sizeof(*tmp_un));
+ }
+ }
/* to give better errors */
if (ret == -1 && errno == ENOENT) {
--
Samba Shared Repository