Tuesday, May 31, 2022

update: net/torsocks: 2.2.0 -> 2.3.0

- upstream moved from github to selfhosted git server
- otherwise this is an update for bugfixes, no major changes
- 'make lib-depends-check' and 'make test' are happy

Tested only on amd64 because I don't have access to other boxes, you
can test it by running tor and invoke:

torsocks curl ifconfig.me

...which will give you a Tor Exit IP.

diff --git a/net/torsocks/Makefile b/net/torsocks/Makefile
index 525a1ae6d38..c224e7e6390 100644
--- a/net/torsocks/Makefile
+++ b/net/torsocks/Makefile
@@ -1,11 +1,6 @@
COMMENT = socks proxy for use with tor

-DISTNAME = torsocks-2.2.0
-REVISION = 0
-
-GH_PROJECT = torsocks
-GH_ACCOUNT = dgoulet
-GH_TAGNAME = v2.2.0
+DISTNAME = torsocks-2.3.0

SHARED_LIBS = torsocks 1.0 # 0.0

@@ -20,6 +15,9 @@ PERMIT_PACKAGE = Yes

WANTLIB += pthread

+MASTER_SITES= https://gitweb.torproject.org/torsocks.git/snapshot/
+EXTRACT_SUFX= .tar.gz
+
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.15

diff --git a/net/torsocks/distinfo b/net/torsocks/distinfo
index f0acdd86eb1..fb8e630a10d 100644
--- a/net/torsocks/distinfo
+++ b/net/torsocks/distinfo
@@ -1,2 +1,2 @@
-SHA256 (torsocks-2.2.0.tar.gz) = NiFqHjD0f6DlvoR2Hg1yEzGWyKBCcWAX2lbpQ5M4yH0=
-SIZE (torsocks-2.2.0.tar.gz) = 115269
+SHA256 (torsocks-2.3.0.tar.gz) = gXwUPoqdIX9BoiOoUTnGyijhuZVWxUf820xy28Fwtsk=
+SIZE (torsocks-2.3.0.tar.gz) = 118033
diff --git a/net/torsocks/patches/patch-Makefile_in b/net/torsocks/patches/patch-Makefile_in
deleted file mode 100644
index ab8734064f3..00000000000
--- a/net/torsocks/patches/patch-Makefile_in
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: Makefile.in
---- Makefile.in.orig
-+++ Makefile.in
-@@ -370,7 +370,7 @@ top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
- ACLOCAL_AMFLAGS = -I config
- SUBDIRS = src doc tests extras
--dist_doc_DATA = ChangeLog
-+dist_doc_DATA =
- EXTRA_DIST = gpl-2.0.txt extras/torsocks-bash_completion
- all: all-recursive
-
diff --git a/net/torsocks/patches/patch-doc_Makefile_in b/net/torsocks/patches/patch-doc_Makefile_in
deleted file mode 100644
index fcf32e50454..00000000000
--- a/net/torsocks/patches/patch-doc_Makefile_in
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: doc/Makefile.in
---- doc/Makefile.in.orig
-+++ doc/Makefile.in
-@@ -595,7 +595,7 @@ info: info-am
-
- info-am:
-
--install-data-am: install-dist_confDATA install-dist_docDATA \
-+install-data-am: install-dist_confDATA \
- install-man
-
- install-dvi: install-dvi-am
diff --git a/net/torsocks/patches/patch-src_bin_torsocks_in b/net/torsocks/patches/patch-src_bin_torsocks_in
index 9fe5fb9a67b..45dbf7de3ba 100644
--- a/net/torsocks/patches/patch-src_bin_torsocks_in
+++ b/net/torsocks/patches/patch-src_bin_torsocks_in
@@ -1,139 +1,12 @@
-Add missing quotes to variable in torsocks.in
-Fixes #19376
-https://github.com/dgoulet/torsocks/commit/5a5b72fa0aef2315c369cedc5f448ee473be5e4f
-
Index: src/bin/torsocks.in
--- src/bin/torsocks.in.orig
+++ src/bin/torsocks.in
-@@ -65,7 +65,7 @@ libdir=@libdir@
+@@ -66,7 +66,7 @@ libdir=@libdir@
LIBDIR="${libdir}/torsocks"
LIB_NAME="libtorsocks"
SHLIB_EXT="@SHLIB_EXT@"
-SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}"
+SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}.${LIBtorsocks_VERSION}"

- # Set @LDPRELOAD@ variable with torsocks library path.
- set_ld_preload ()
-@@ -73,7 +73,7 @@ set_ld_preload ()
- if [ -z "$@LDPRELOAD@" ]; then
- export @LDPRELOAD@="${SHLIB}"
- else
-- echo $@LDPRELOAD@ | grep -q "${SHLIB}" || \
-+ echo "$@LDPRELOAD@" | grep -q "${SHLIB}" || \
- export @LDPRELOAD@="${SHLIB} $@LDPRELOAD@"
- fi
-
-@@ -130,13 +130,13 @@ tor_shell ()
-
- torify_app ()
- {
-- local app_path=`which $1`
-- local getcap=`PATH="$PATH:/usr/sbin:/sbin" which getcap`
-+ local app_path="`which $1`"
-+ local getcap="`PATH="$PATH:/usr/sbin:/sbin" which getcap`"
- local caps=
-
-- if [ -z $1 ]; then
-+ if [ -z "$1" ]; then
- echo "Please provide an application to torify." >&2
-- elif [ -z $app_path ]; then
-+ elif [ -z "$app_path" ]; then
- echo "ERROR: $1 cannot be found." >&2
- exit 1
- fi
-@@ -144,20 +144,20 @@ torify_app ()
- # This must be before torifying because getcap uses cap_get_file(3)
- # via syscall(2) which breaks torsocks.
- if [ -n "$getcap" ]; then
-- caps=`$getcap $app_path`
-+ caps="`$getcap $app_path 2>/dev/null`"
- fi
-
- # Check if Apple's System Integrity Protection is enabled if the user is
- # running on macOS.
-- macos_sip_check $app_path
-+ macos_sip_check "$app_path"
-
- # NEVER remove that line or else nothing it torified.
- set_ld_preload
-
-- if [ -u $app_path ]; then
-+ if [ -u "$app_path" ]; then
- echo "ERROR: $1 is setuid. torsocks will not work on a setuid executable." >&2
- exit 1
-- elif [ -g $app_path ]; then
-+ elif [ -g "$app_path" ]; then
- echo "ERROR: $1 is setgid. torsocks will not work on a setgid executable." >&2
- exit 1
- elif [ -n "$caps" ]; then
-@@ -219,7 +219,7 @@ if [ $# -eq 0 ] ; then
- fi
-
- # Ensure libtorsocks exists,
--if [ ! -f $SHLIB ]; then
-+if [ ! -f "$SHLIB" ]; then
- echo "$0: $SHLIB does not exist! Try re-installing torsocks."
- exit
- fi
-@@ -228,14 +228,14 @@ while true;
- do
- case "$1" in
- on)
-- check_script_sourced $1
-+ check_script_sourced "$1"
- set_ld_preload
- echo "Tor mode activated. Every command will be torified for this shell."
- break
- ;;
- off)
-- check_script_sourced $1
-- export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s#$SHLIB *##"`
-+ check_script_sourced "$1"
-+ export @LDPRELOAD@="`echo -n $@LDPRELOAD@ | sed "s#$SHLIB *##"`"
- if [ -z "$@LDPRELOAD@" ]; then
- unset @LDPRELOAD@
- case "$OSTYPE" in
-@@ -256,35 +256,35 @@ do
- break
- ;;
- -u|--user)
-- if [ -z $2 ]; then
-+ if [ -z "$2" ]; then
- echo "Missing username to -u" >&2
- exit 1
- fi
-- export TORSOCKS_USERNAME=$2
-+ export TORSOCKS_USERNAME="$2"
- shift
- ;;
- -p|--pass)
-- if [ -z $2 ]; then
-+ if [ -z "$2" ]; then
- echo "Missing password to -p" >&2
- exit 1
- fi
-- export TORSOCKS_PASSWORD=$2
-+ export TORSOCKS_PASSWORD="$2"
- shift
- ;;
- -a|--address)
-- if [ -z $2 ]; then
-+ if [ -z "$2" ]; then
- echo "Missing address to -a" >&2
- exit 1
- fi
-- export TORSOCKS_TOR_ADDRESS=$2
-+ export TORSOCKS_TOR_ADDRESS="$2"
- shift
- ;;
- -P|--port)
-- if [ -z $2 ]; then
-+ if [ -z "$2" ]; then
- echo "Missing port to -P" >&2
- exit 1
- fi
-- export TORSOCKS_TOR_PORT=$2
-+ export TORSOCKS_TOR_PORT="$2"
- shift
- ;;
- -i|--isolate)
+ # https://github.com/mkropat/sh-realpath
+ #
diff --git a/net/torsocks/patches/patch-src_common_compat_h b/net/torsocks/patches/patch-src_common_compat_h
index cad5bbd4714..f9077926bd5 100644
--- a/net/torsocks/patches/patch-src_common_compat_h
+++ b/net/torsocks/patches/patch-src_common_compat_h
@@ -20,7 +20,7 @@ Index: src/common/compat.h

#if defined(__linux__)
#include <unistd.h>
-@@ -176,7 +177,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine
+@@ -196,7 +197,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine

No comments:

Post a Comment