summaryrefslogtreecommitdiff
path: root/opt/torsocks
diff options
context:
space:
mode:
Diffstat (limited to 'opt/torsocks')
-rw-r--r--opt/torsocks/.footprint19
-rw-r--r--opt/torsocks/.signature8
-rw-r--r--opt/torsocks/MAKEPKG37
-rw-r--r--opt/torsocks/implicit-function-decl.patch30
-rw-r--r--opt/torsocks/torsocks-2.4.0-configure.patch23
5 files changed, 117 insertions, 0 deletions
diff --git a/opt/torsocks/.footprint b/opt/torsocks/.footprint
new file mode 100644
index 0000000..27ded41
--- /dev/null
+++ b/opt/torsocks/.footprint
@@ -0,0 +1,19 @@
+drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/tor/
+-rw-r--r-- root/root etc/tor/torsocks.conf
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/torsocks
+drwxr-xr-x root/root usr/lib/
+drwxr-xr-x root/root usr/lib/torsocks/
+-rwxr-xr-x root/root usr/lib/torsocks/libtorsocks.so.0.0.0
+lrwxrwxrwx root/root usr/lib/torsocks/libtorsocks.so -> libtorsocks.so.0.0.0
+lrwxrwxrwx root/root usr/lib/torsocks/libtorsocks.so.0 -> libtorsocks.so.0.0.0
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/torsocks.1.gz
+drwxr-xr-x root/root usr/share/man/man5/
+-rw-r--r-- root/root usr/share/man/man5/torsocks.conf.5.gz
+drwxr-xr-x root/root usr/share/man/man8/
+-rw-r--r-- root/root usr/share/man/man8/torsocks.8.gz
diff --git a/opt/torsocks/.signature b/opt/torsocks/.signature
new file mode 100644
index 0000000..bef18f2
--- /dev/null
+++ b/opt/torsocks/.signature
@@ -0,0 +1,8 @@
+RWTZ9IduCSQ/mOnshkz0uIadaKDg46UmJeudPYNbGfI2/ouC31Hveo/BaIHkfF8rUJy9S/W9YsGhDQBd1t4xzxuXWn1i41sEUAk=
+
+SHA256 (MAKEPKG) = fc0f55d01a1f66d34817978feaf38de407e07738e8cf635c8f58aef384f146a1
+SHA256 (.footprint) = cd8de7ed9a06fdd399a05dd0fbd5a0f3c88410bf3338c870b5d41310308410e2
+SHA256 (torsocks-v2.5.0.tar.gz) = 0fc8e18f2dc2e12f1129054f6d5acc7ecc3f0345bb57ed653fc8c6674e6ecc7e
+SHA256 (implicit-function-decl.patch) = 4b6a06736102dd6744996b885df5cbdae6279b78a4502fe8eba61c4feeae6986
+SHA256 (torsocks-2.4.0-configure.patch) = 69b049ede422d4cb7c6277b3303b926ac7c1fc37bd5f96ae993c0fc5e4d66e5c
+SHA256 (torsocks#2.5.0-1.pkg.tar.gz) = e3fe73b155cdb9792f6d2416f164a0be6c9d26b4c4afcd57308b71717a702713
diff --git a/opt/torsocks/MAKEPKG b/opt/torsocks/MAKEPKG
new file mode 100644
index 0000000..e5ba86a
--- /dev/null
+++ b/opt/torsocks/MAKEPKG
@@ -0,0 +1,37 @@
+#!/bin/mkpkg
+# description: Use most applications safely with Tor via LD_PRELOAD
+# url: https://gitlab.torproject.org/tpo/core/torsocks
+name=torsocks
+version=2.5.0
+release=1
+depends=()
+makedeps=()
+source=(https://gitlab.torproject.org/tpo/core/torsocks/-/archive/v$version/torsocks-v$version.tar.gz
+ implicit-function-decl.patch
+ torsocks-2.4.0-configure.patch)
+sha256sums=(
+ "0fc8e18f2dc2e12f1129054f6d5acc7ecc3f0345bb57ed653fc8c6674e6ecc7e"
+ "4b6a06736102dd6744996b885df5cbdae6279b78a4502fe8eba61c4feeae6986"
+ "69b049ede422d4cb7c6277b3303b926ac7c1fc37bd5f96ae993c0fc5e4d66e5c"
+)
+build() {
+ cd torsocks-v$version
+ patch -p1 < ../implicit-function-decl.patch
+ patch -p1 < ../torsocks-2.4.0-configure.patch
+ autoreconf -fi
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --disable-static
+ make
+ make DESTDIR=$PKG install
+ rm -rf $PKG/usr/share/doc
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh
+
diff --git a/opt/torsocks/implicit-function-decl.patch b/opt/torsocks/implicit-function-decl.patch
new file mode 100644
index 0000000..f9fe882
--- /dev/null
+++ b/opt/torsocks/implicit-function-decl.patch
@@ -0,0 +1,30 @@
+--- a/src/common/config-file.c
++++ b/src/common/config-file.c
+@@ -23,6 +23,7 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <sys/socket.h>
+
+ #include "config-file.h"
+@@ -56,6 +57,8 @@ static const char *isolate_username_fmt
+ /* Default password for the IsolatePID option. */
+ static const char *isolate_password = "0";
+
++ATTR_HIDDEN
++int conf_file_set_enable_ipv6(const char *val, struct configuration *config);
+ /*
+ * Set the onion pool address range in the configuration object using the value
+ * found in the conf file.
+--- a/src/lib/torsocks.c
++++ b/src/lib/torsocks.c
+@@ -59,6 +59,8 @@ static TSOCKS_INIT_ONCE(term_once);
+ */
+ static int is_suid;
+
++ATTR_HIDDEN
++int conf_file_set_enable_ipv6(const char *val, struct configuration *config);
+ /*
+ * Cleanup and exit with the given status. Note that the lib destructor will be
+ * called after this call.
diff --git a/opt/torsocks/torsocks-2.4.0-configure.patch b/opt/torsocks/torsocks-2.4.0-configure.patch
new file mode 100644
index 0000000..96af0b4
--- /dev/null
+++ b/opt/torsocks/torsocks-2.4.0-configure.patch
@@ -0,0 +1,23 @@
+Fix bashism in libc.so filename check, and don't unconditionally set _F_S=2,
+as it clobbers e.g. _F_S=3.
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,7 +124,7 @@ AS_CASE([$host_os],
+ [linux*|kfreebsd*-gnu|freebsd*],
+ [
+ libc_name=`ldd /usr/bin/yes | grep 'libc\.' | cut -d ' ' -f 1 | tr -d '\t'`
+- if test "${libc_name}" == ""; then
++ if test "${libc_name}" = ""; then
+ # Default libc on most system.
+ libc_name="libc.so.6"
+ fi
+@@ -258,9 +258,6 @@ AX_CHECK_LINK_FLAG([-pie],[LDFLAGS="$LDFLAGS -pie"],[],[])
+ AX_CHECK_LINK_FLAG([-z relro],[LDFLAGS="$LDFLAGS -z relro"],[],[])
+ AX_CHECK_LINK_FLAG([-z now],[LDFLAGS="$LDFLAGS -z now"],[],[])
+
+-dnl Add glibc hardening
+-CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
+-
+ ##############################################################################
+ # 10. Finish up
+ ##############################################################################