From: openbsd@systemfailure.net Subject: [update] torsocks 2.5.0 To: Pascal Stumpf ,ports@openbsd.org Date: Sat, 29 Mar 2025 16:26:53 +0000 Hi, Here's an update for torsocks. Version 2.5.0 fixes bugs and improves documentation (Changelog: https://gitlab.torproject.org/tpo/core/torsocks/-/blob/main/ChangeLog). I had to update some patches and add one more patch for src/lib/getaddrinfo.c . My patches are probably ugly, sorry, but at least with them, the port builds, runs fine, and all tests are passing. People who know better than me could use them as a basis for a cleaner update. Best regards. Index: Makefile =================================================================== RCS file: /cvs/ports/net/torsocks/Makefile,v diff -u -p -r1.19 Makefile --- Makefile 31 Jan 2024 22:46:19 -0000 1.19 +++ Makefile 29 Mar 2025 16:07:07 -0000 @@ -1,6 +1,6 @@ COMMENT = SOCKS proxy for use with Tor -V = 2.4.0 +V = 2.5.0 DISTNAME = torsocks-v${V} PKGNAME = ${DISTNAME:S/v//} Index: distinfo =================================================================== RCS file: /cvs/ports/net/torsocks/distinfo,v diff -u -p -r1.5 distinfo --- distinfo 31 Jan 2024 22:46:19 -0000 1.5 +++ distinfo 29 Mar 2025 16:07:07 -0000 @@ -1,2 +1,2 @@ -SHA256 (torsocks-v2.4.0.tar.gz) = wBtHHYntqfPI3LhaRI6AZmktBwf5/4sqx+ZlpgIpG4c= -SIZE (torsocks-v2.4.0.tar.gz) = 118991 +SHA256 (torsocks-v2.5.0.tar.gz) = D8jhjy3C4S8RKQVPbVrMfsw/A0W7V+1lP8jGZ05uzH4= +SIZE (torsocks-v2.5.0.tar.gz) = 122020 Index: patches/patch-configure_ac =================================================================== RCS file: /cvs/ports/net/torsocks/patches/patch-configure_ac,v diff -u -p -r1.1 patch-configure_ac --- patches/patch-configure_ac 11 Nov 2023 11:51:22 -0000 1.1 +++ patches/patch-configure_ac 29 Mar 2025 16:07:07 -0000 @@ -5,16 +5,18 @@ For upstream: needs an autoheader call t Index: configure.ac --- configure.ac.orig +++ configure.ac -@@ -53,10 +53,12 @@ AC_CHECK_HEADERS(dlfcn.h sys/syscall.h sys/socket.h ar +@@ -53,13 +53,14 @@ AC_CHECK_HEADERS(dlfcn.h sys/syscall.h sys/socket.h ar dnl Checks for required library functions. AC_CHECK_FUNCS(strcspn strdup strerror strcasecmp strncasecmp mmap munmap \ - socket connect close syscall recv send memset memcpy strlen \ + socket connect close recv send memset memcpy strlen \ - strncpy strcmp malloc calloc strstr strtoul free,, + strcmp malloc calloc strstr strtoul free,, [AC_MSG_ERROR("Required function not found")] ) -+dnl Checks for optional library functions + + dnl Checks for optional library functions. + AC_CHECK_FUNCS(strlcpy strlcat) +AC_CHECK_FUNCS(syscall __syscall,,) ############################################################################## Index: patches/patch-src_common_compat_c =================================================================== RCS file: /cvs/ports/net/torsocks/patches/patch-src_common_compat_c,v diff -u -p -r1.2 patch-src_common_compat_c --- patches/patch-src_common_compat_c 11 Mar 2022 19:47:53 -0000 1.2 +++ patches/patch-src_common_compat_c 29 Mar 2025 16:07:07 -0000 @@ -9,9 +9,9 @@ Index: src/common/compat.c + defined(__darwin__) || defined(__NetBSD__) || \ + defined(__OpenBSD__)) - /* - * Initialize a pthread mutex. This never fails. -@@ -97,4 +98,4 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine + /* Inline the strl functions if the platform doesn't have them. */ + #ifndef HAVE_STRLCPY +@@ -105,4 +106,4 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine tsocks_mutex_unlock(&o->mutex); } Index: patches/patch-src_common_compat_h =================================================================== RCS file: /cvs/ports/net/torsocks/patches/patch-src_common_compat_h,v diff -u -p -r1.4 patch-src_common_compat_h --- patches/patch-src_common_compat_h 31 Jan 2024 22:46:19 -0000 1.4 +++ patches/patch-src_common_compat_h 29 Mar 2025 16:07:07 -0000 @@ -11,7 +11,7 @@ Index: src/common/compat.h #ifndef RTLD_NEXT #define RTLD_NEXT ((void *) -1) -@@ -58,7 +59,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine +@@ -65,7 +66,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine #else #error "OS not supported." @@ -20,7 +20,7 @@ Index: src/common/compat.h #if defined(__linux__) #include -@@ -204,7 +205,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine +@@ -211,7 +212,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine #endif /* __linux__ */ @@ -30,7 +30,7 @@ Index: src/common/compat.h #include #include -@@ -223,7 +225,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine +@@ -230,7 +232,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine #define TSOCKS_NR_LISTEN SYS_listen #define TSOCKS_NR_RECVMSG SYS_recvmsg Index: patches/patch-src_lib_getaddrinfo_c =================================================================== RCS file: patches/patch-src_lib_getaddrinfo_c diff -N patches/patch-src_lib_getaddrinfo_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_lib_getaddrinfo_c 29 Mar 2025 16:07:07 -0000 @@ -0,0 +1,21 @@ +Index: src/lib/getaddrinfo.c +--- src/lib/getaddrinfo.c.orig ++++ src/lib/getaddrinfo.c +@@ -74,7 +74,7 @@ LIBC_GETADDRINFO_RET_TYPE tsocks_getaddrinfo(LIBC_GETA + .ai_socktype = 0, + .ai_protocol = 0, + .ai_family = AF_UNSPEC, +- .ai_flags = AI_V4MAPPED | AI_ADDRCONFIG, ++ .ai_flags = AI_ADDRCONFIG, + }; + } + +@@ -82,7 +82,7 @@ LIBC_GETADDRINFO_RET_TYPE tsocks_getaddrinfo(LIBC_GETA + * Tor doesn't support v4 mapped addresses, so don't request them. + * https://gitlab.torproject.org/tpo/core/tor/-/issues/40611 + */ +- tmp_hints.ai_flags &= ~AI_V4MAPPED; ++ /* tmp_hints.ai_flags &= ~AI_V4MAPPED; */ + + /* Use right domain for the next step. */ + switch (tmp_hints.ai_family) {