From ac2ed23d50453ccea19238df96b7e63c0e48160e06bd47418cd51cc440f67a93 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 14 Dec 2022 10:09:58 +0000 Subject: [PATCH 1/3] Accepting request 1040684 from home:polslinux:branches:network:utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update to 1.7.4.4: * FIX: In error.c msg2() there was a stack overflow on long messages: The terminating \0 Byte was written behind the last position. * FIX: UDP-RECVFROM with fork sometimes terminated when multiple packets arrived. * FIX: a couple of weaknesses and errors when accessing invalid or  incompatible file system entries with UNIX domain, file, and generic addresses. * FIX: bad parser error message on "socat /tmp/x\"x/x -" - Drop socat-fix-asan-error.patch OBS-URL: https://build.opensuse.org/request/show/1040684 OBS-URL: https://build.opensuse.org/package/show/network:utilities/socat?expand=0&rev=62 --- socat-1.7.4.3.tar.gz | 3 --- socat-1.7.4.4.tar.gz | 3 +++ socat-common-fixes.patch | 18 +++++++++--------- socat-fix-asan-error.patch | 13 ------------- socat-ignore-tests-failure-boo1078346.patch | 8 ++++---- socat.changes | 14 ++++++++++++++ socat.spec | 3 +-- 7 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 socat-1.7.4.3.tar.gz create mode 100644 socat-1.7.4.4.tar.gz delete mode 100644 socat-fix-asan-error.patch diff --git a/socat-1.7.4.3.tar.gz b/socat-1.7.4.3.tar.gz deleted file mode 100644 index 02f505b..0000000 --- a/socat-1.7.4.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d697245144731423ddbbceacabbd29447089ea223e9a439b28f9ff90d0dd216e -size 655520 diff --git a/socat-1.7.4.4.tar.gz b/socat-1.7.4.4.tar.gz new file mode 100644 index 0000000..255ff89 --- /dev/null +++ b/socat-1.7.4.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f8f4b9d5c60b8c53d17b60d79ababc4a0f51b3bb6d2bd3ae8a6a4b9d68f195e +size 662968 diff --git a/socat-common-fixes.patch b/socat-common-fixes.patch index b871940..ec6d74b 100644 --- a/socat-common-fixes.patch +++ b/socat-common-fixes.patch @@ -1,7 +1,7 @@ -Index: socat-1.7.4.1/filan.c +Index: socat-1.7.4.4/filan.c =================================================================== ---- socat-1.7.4.1.orig/filan.c -+++ socat-1.7.4.1/filan.c +--- socat-1.7.4.4.orig/filan.c ++++ socat-1.7.4.4/filan.c @@ -20,6 +20,10 @@ #include "filan.h" @@ -13,10 +13,10 @@ Index: socat-1.7.4.1/filan.c struct sockopt { int so; -Index: socat-1.7.4.1/procan.c +Index: socat-1.7.4.4/procan.c =================================================================== ---- socat-1.7.4.1.orig/procan.c -+++ socat-1.7.4.1/procan.c +--- socat-1.7.4.4.orig/procan.c ++++ socat-1.7.4.4/procan.c @@ -16,6 +16,9 @@ #include "filan.h" @@ -27,10 +27,10 @@ Index: socat-1.7.4.1/procan.c #include "procan.h" -Index: socat-1.7.4.1/xio-tcpwrap.c +Index: socat-1.7.4.4/xio-tcpwrap.c =================================================================== ---- socat-1.7.4.1.orig/xio-tcpwrap.c -+++ socat-1.7.4.1/xio-tcpwrap.c +--- socat-1.7.4.4.orig/xio-tcpwrap.c ++++ socat-1.7.4.4/xio-tcpwrap.c @@ -13,6 +13,7 @@ #include "xio-tcpwrap.h" diff --git a/socat-fix-asan-error.patch b/socat-fix-asan-error.patch deleted file mode 100644 index 0665878..0000000 --- a/socat-fix-asan-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/error.c b/error.c -index 3135fd5..eacfec5 100644 ---- a/error.c -+++ b/error.c -@@ -360,7 +360,7 @@ void msg2( - if (handler) bufp[-1] = tolower(bufp[-1]); /* for debugging, low chars indicate messages from signal handlers */ - #endif - *bufp++ = ' '; -- strncpy(bufp, text, BUFLEN-(bufp-buff)-1); -+ strncpy(bufp, text, BUFLEN-(bufp-buff)-2); - strcat(bufp, "\n"); - _msg(level, buff, syslp); - if (level >= diagopts.exitlevel) { diff --git a/socat-ignore-tests-failure-boo1078346.patch b/socat-ignore-tests-failure-boo1078346.patch index 591544a..c1f0f14 100644 --- a/socat-ignore-tests-failure-boo1078346.patch +++ b/socat-ignore-tests-failure-boo1078346.patch @@ -10,11 +10,11 @@ Signed-off-by: Michel Normand test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: socat-1.7.4.1/test.sh +Index: socat-1.7.4.4/test.sh =================================================================== ---- socat-1.7.4.1.orig/test.sh -+++ socat-1.7.4.1/test.sh -@@ -15042,7 +15042,7 @@ if [ "$numCANT" -gt 0 ]; then +--- socat-1.7.4.4.orig/test.sh ++++ socat-1.7.4.4/test.sh +@@ -15736,7 +15736,7 @@ if [ "$numCANT" -gt 0 ]; then fi if [ "$numFAIL" -gt 0 ]; then echo "FAILED: $listFAIL" diff --git a/socat.changes b/socat.changes index 5351fc2..fecb7a8 100644 --- a/socat.changes +++ b/socat.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Tue Dec 6 13:46:41 UTC 2022 - Paolo Stivanin + +- Update to 1.7.4.4: + * FIX: In error.c msg2() there was a stack overflow on long messages: The + terminating \0 Byte was written behind the last position. + * FIX: UDP-RECVFROM with fork sometimes terminated when multiple packets + arrived. + * FIX: a couple of weaknesses and errors when accessing invalid or +  incompatible file system entries with UNIX domain, file, and generic + addresses. + * FIX: bad parser error message on "socat /tmp/x\"x/x -" +- Drop socat-fix-asan-error.patch + ------------------------------------------------------------------- Wed Apr 13 07:41:15 UTC 2022 - Martin Liška diff --git a/socat.spec b/socat.spec index f6078a7..f59b039 100644 --- a/socat.spec +++ b/socat.spec @@ -18,7 +18,7 @@ Name: socat -Version: 1.7.4.3 +Version: 1.7.4.4 Release: 0 Summary: Multipurpose relay for bidirectional data transfer License: MIT AND SUSE-GPL-2.0-with-openssl-exception @@ -28,7 +28,6 @@ Source: http://www.dest-unreach.org/socat/download/%{name}-%{version}.ta Source1: %{name}.changes Patch1: socat-ignore-tests-failure-boo1078346.patch Patch2: socat-common-fixes.patch -Patch3: socat-fix-asan-error.patch BuildRequires: iputils BuildRequires: net-tools BuildRequires: openssl-devel From 38c2536074343b7de024c433229a4c2894390c3ef9042ec88c6cc029b02c9532 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 2 May 2024 09:47:59 +0000 Subject: [PATCH 2/3] Accepting request 1171181 from home:crameleon:branches:network:utilities - Update to 1.8.0.0: * Support for network namespaces (option netns) * TCP client now automatically tries all addresses (IPv4 and IPv6) provided by nameserver until success * Implementation of POSIX message queue (mq) control and access on Linux (addresses POSIXMQ-READ and following) * New wrapper script socat-chain.sh allows to stack two addresses, e.g.HTTP proxy connect over SSL * New script socat-mux.sh allows n-to-1 / 1-to-n communications * New script socat-broker.sh allows group communications * Experimental socks5 client feature * Address ACCEPT-FD for systemd "inetd" mode * UDP-Lite and DCCP address types * Addresses SOCKETPAIR and SHELL * New option bind-tmpname allows forked off children to bind UNIX domain client sockets to random unique pathes * New option retrieve-vlan (with INTERFACE addresses) now makes kernel keep VLAN tags in incoming packets * Simple statistics output with Socat option --statistics and with SIGUSR1 * A couple of new options, many fixes and corrections, see file CHANGES - Drop socat-common-fixes.patch (no longer necessary) - Refactor socat-ignore-tests-failure-boo1078346.patch (test suite no longer exits at this stage) - Add socat-test-dhparam fixture (reduce build load and time) - Note: This version introduces "socat1", linking to "socat" - Note: This version introduces additional shell scripts, those are shipped in a new "socat-extra" subpackage OBS-URL: https://build.opensuse.org/request/show/1171181 OBS-URL: https://build.opensuse.org/package/show/network:utilities/socat?expand=0&rev=63 --- socat-1.7.4.4.tar.gz | 3 -- socat-1.8.0.0.tar.gz | 3 ++ socat-common-fixes.patch | 41 --------------------- socat-ignore-tests-failure-boo1078346.patch | 25 +++---------- socat-test-dhparam | 8 ++++ socat-test-without-tty.patch | 20 ++++++++++ socat.changes | 26 +++++++++++++ socat.spec | 30 +++++++++++++-- 8 files changed, 89 insertions(+), 67 deletions(-) delete mode 100644 socat-1.7.4.4.tar.gz create mode 100644 socat-1.8.0.0.tar.gz delete mode 100644 socat-common-fixes.patch create mode 100644 socat-test-dhparam create mode 100644 socat-test-without-tty.patch diff --git a/socat-1.7.4.4.tar.gz b/socat-1.7.4.4.tar.gz deleted file mode 100644 index 255ff89..0000000 --- a/socat-1.7.4.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f8f4b9d5c60b8c53d17b60d79ababc4a0f51b3bb6d2bd3ae8a6a4b9d68f195e -size 662968 diff --git a/socat-1.8.0.0.tar.gz b/socat-1.8.0.0.tar.gz new file mode 100644 index 0000000..66fc323 --- /dev/null +++ b/socat-1.8.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6010f4f311e5ebe0e63c77f78613d264253680006ac8979f52b0711a9a231e82 +size 712469 diff --git a/socat-common-fixes.patch b/socat-common-fixes.patch deleted file mode 100644 index ec6d74b..0000000 --- a/socat-common-fixes.patch +++ /dev/null @@ -1,41 +0,0 @@ -Index: socat-1.7.4.4/filan.c -=================================================================== ---- socat-1.7.4.4.orig/filan.c -+++ socat-1.7.4.4/filan.c -@@ -20,6 +20,10 @@ - - #include "filan.h" - -+#ifdef WITH_LIBWRAP -+#include -+#endif -+ - - struct sockopt { - int so; -Index: socat-1.7.4.4/procan.c -=================================================================== ---- socat-1.7.4.4.orig/procan.c -+++ socat-1.7.4.4/procan.c -@@ -16,6 +16,9 @@ - #include "filan.h" - - #include -+#ifdef WITH_LIBWRAP -+#include -+#endif - - #include "procan.h" - -Index: socat-1.7.4.4/xio-tcpwrap.c -=================================================================== ---- socat-1.7.4.4.orig/xio-tcpwrap.c -+++ socat-1.7.4.4/xio-tcpwrap.c -@@ -13,6 +13,7 @@ - #include "xio-tcpwrap.h" - - -+ - #if (WITH_TCP || WITH_UDP) && WITH_LIBWRAP - - const struct optdesc opt_tcpwrappers = { "tcpwrappers", "tcpwrap", OPT_TCPWRAPPERS, GROUP_RANGE, PH_ACCEPT, TYPE_STRING_NULL, OFUNC_SPEC }; diff --git a/socat-ignore-tests-failure-boo1078346.patch b/socat-ignore-tests-failure-boo1078346.patch index c1f0f14..19c7331 100644 --- a/socat-ignore-tests-failure-boo1078346.patch +++ b/socat-ignore-tests-failure-boo1078346.patch @@ -1,25 +1,10 @@ -From: Michel Normand -Subject: socat ignore tests failure boo1078346 -Date: Wed, 31 Jan 2018 10:19:54 +0100 - -socat ignore flaky tests failure boo1078346 -for PowerPC and S390 - -Signed-off-by: Michel Normand ---- - test.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: socat-1.7.4.4/test.sh -=================================================================== ---- socat-1.7.4.4.orig/test.sh -+++ socat-1.7.4.4/test.sh -@@ -15736,7 +15736,7 @@ if [ "$numCANT" -gt 0 ]; then +--- a/test.sh 2023-11-13 20:31:08.000000000 +0100 ++++ b/test.sh 2024-05-01 21:16:36.479550579 +0200 +@@ -19239,6 +19239,7 @@ fi if [ "$numFAIL" -gt 0 ]; then echo "FAILED: $listFAIL" -- exit 1 -+ uname -p | grep -qE 'ppc|s390' && { echo "ignore flaky failures, bypass boo#1078346"; exit 0; } || exit 1 ++ uname -p | grep -qE 'ppc|s390' && { echo "ignore flaky failures, bypass boo#1078346"; exit 0; } && exit fi - exit 0 + if [ -z "$OPT_EXPECT_FAIL" ]; then diff --git a/socat-test-dhparam b/socat-test-dhparam new file mode 100644 index 0000000..dfb495d --- /dev/null +++ b/socat-test-dhparam @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBDAKCAQEAi07zA4IHy7z3zO1Z80pW4ODsfoGkK37EimJ1mxg16W2EaskIHSO1 +phICWQFxHJVamtLDdxgcH6FIUw6oznkkkpKqhd3iRQbb4vV0T3bxe7595ic+l5Cb +9pnh90PW5//CxSen5tgsdGAqWvzybupGcN1TlTEyNsfL/By4J9l5p6btmtpdMbqO +AgUpZzkQQvUw+WBNBcqImcH3PIM69yzHQJw5fxE67h/upDyaqJh25PKMmGpOwBVP +QDzmNx0znB/Hop+1YUJJjiuCnFJLSvLacLjHB3sg70EIuG9Kaw4Krrblf3YP5SjY +002fW2pSR0A8wIKtjc0ApZHgK7Xad3SpHwIBAgICAOE= +-----END DH PARAMETERS----- diff --git a/socat-test-without-tty.patch b/socat-test-without-tty.patch new file mode 100644 index 0000000..4162300 --- /dev/null +++ b/socat-test-without-tty.patch @@ -0,0 +1,20 @@ +--- a/test.sh 2023-11-13 20:31:08.000000000 +0100 ++++ b/test.sh 2024-05-01 21:25:27.709337509 +0200 +@@ -16054,9 +16054,15 @@ + pid0=$! + relsleep 2 + TTY=$(tty |sed 's|/dev/||') +-pkill -USR1 -t $TTY socat || { echo "pkill -t $TTY -USR1 socat"; } ++if [ "$TTY" = 'not a tty' ] ++then ++ TTY='' ++else ++ TTY="-t $TTY" ++fi ++pkill -USR1 $TTY socat || { echo "pkill $TTY -USR1 socat"; } + relsleep 1 +-pkill -t $TTY socat ++pkill $TTY socat + wait + if [ "$(grep STATISTICS "${te}0" |wc -l)" -eq 2 ]; then + $PRINTF "$OK\n" diff --git a/socat.changes b/socat.changes index fecb7a8..5e002e5 100644 --- a/socat.changes +++ b/socat.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Wed May 1 18:50:03 UTC 2024 - Georg Pfuetzenreuter + +- Update to 1.8.0.0: + * Support for network namespaces (option netns) + * TCP client now automatically tries all addresses (IPv4 and IPv6) provided by nameserver until success + * Implementation of POSIX message queue (mq) control and access on Linux (addresses POSIXMQ-READ and following) + * New wrapper script socat-chain.sh allows to stack two addresses, e.g.HTTP proxy connect over SSL + * New script socat-mux.sh allows n-to-1 / 1-to-n communications + * New script socat-broker.sh allows group communications + * Experimental socks5 client feature + * Address ACCEPT-FD for systemd "inetd" mode + * UDP-Lite and DCCP address types + * Addresses SOCKETPAIR and SHELL + * New option bind-tmpname allows forked off children to bind UNIX domain client sockets to random unique pathes + * New option retrieve-vlan (with INTERFACE addresses) now makes kernel keep VLAN tags in incoming packets + * Simple statistics output with Socat option --statistics and with SIGUSR1 + * A couple of new options, many fixes and corrections, see file CHANGES + +- Drop socat-common-fixes.patch (no longer necessary) +- Refactor socat-ignore-tests-failure-boo1078346.patch (test suite no longer exits at this stage) +- Add socat-test-dhparam fixture (reduce build load and time) + +- Note: This version introduces "socat1", linking to "socat" +- Note: This version introduces additional shell scripts, those are shipped in a new "socat-extra" subpackage + ------------------------------------------------------------------- Tue Dec 6 13:46:41 UTC 2022 - Paolo Stivanin diff --git a/socat.spec b/socat.spec index f59b039..436d171 100644 --- a/socat.spec +++ b/socat.spec @@ -1,7 +1,7 @@ # # spec file for package socat # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # Copyright (c) 2010 Pascal Bleser # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: socat -Version: 1.7.4.4 +Version: 1.8.0.0 Release: 0 Summary: Multipurpose relay for bidirectional data transfer License: MIT AND SUSE-GPL-2.0-with-openssl-exception @@ -26,8 +26,12 @@ Group: Productivity/Networking/Other URL: http://www.dest-unreach.org/socat/ Source: http://www.dest-unreach.org/socat/download/%{name}-%{version}.tar.gz Source1: %{name}.changes +Source2: socat-test-dhparam +# TODO: as of 1.8.0.0, test.sh supports "--expect-fail ", this should be used +# instead of ignoring all test failures Patch1: socat-ignore-tests-failure-boo1078346.patch -Patch2: socat-common-fixes.patch +# Support build environments without a TTY +Patch2: socat-test-without-tty.patch BuildRequires: iputils BuildRequires: net-tools BuildRequires: openssl-devel @@ -52,6 +56,16 @@ IP4, IP6 - raw, UDP, TCP), an SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU line editor, a program, or a combination of two of these. +%package extra +Summary: Additional scripts for socat +Requires: %{name} = %{version} + +%description extra +This ships the following scripts: +- socat-broker.sh +- socat-chain.sh +- socat-mux.sh + %prep %autosetup sed 's|#! %{_bindir}/env bash|#!%{_bindir}/bash|' -i proxyecho.sh readline.sh @@ -73,6 +87,9 @@ mkdir -p \ %{buildroot}/%{_mandir}/man1 %make_install +# avoid expensive dhparam generation on every build with enabled checks +cp %{SOURCE2} testcert.dh + %check export TERM=ansi # use a small but safe subset of all tests @@ -90,8 +107,15 @@ export OPTS="-t 2" %license COPYING COPYING.OpenSSL %doc BUGREPORTS CHANGES DEVELOPMENT EXAMPLES FAQ FILES PORTING README SECURITY VERSION examples %{_bindir}/socat +%{_bindir}/socat1 %{_bindir}/procan %{_bindir}/filan %{_mandir}/man1/socat.1%{?ext_man} +%{_mandir}/man1/socat1.1%{?ext_man} + +%files extra +%{_bindir}/socat-broker.sh +%{_bindir}/socat-chain.sh +%{_bindir}/socat-mux.sh %changelog From b0cbc9b8f97e4d22584810ec27e0336d26faca0ab8a50acb333c48c3c4baf613 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 2 May 2024 09:55:53 +0000 Subject: [PATCH 3/3] - Add socat-test-without-tty.patch for testing without tty. OBS-URL: https://build.opensuse.org/package/show/network:utilities/socat?expand=0&rev=64 --- socat.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/socat.changes b/socat.changes index 5e002e5..06fbc1e 100644 --- a/socat.changes +++ b/socat.changes @@ -20,6 +20,7 @@ Wed May 1 18:50:03 UTC 2024 - Georg Pfuetzenreuter