summaryrefslogtreecommitdiff
path: root/net-proxy/torsocks
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-10-13 22:19:36 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-10-14 23:22:23 +0100
commit4b19be30aa626b327c885dae62c559ec0e9fb935 (patch)
tree76e74807bc479502e13866b581b6bf86734ec634 /net-proxy/torsocks
parent30d6f67c98d149508509d5e86f176d558793acc0 (diff)
gentoo resync : 13.10.2019
Diffstat (limited to 'net-proxy/torsocks')
-rw-r--r--net-proxy/torsocks/Manifest3
-rw-r--r--net-proxy/torsocks/files/torsocks-2.3.0-fix-syscall.patch94
-rw-r--r--net-proxy/torsocks/torsocks-2.3.0.ebuild48
3 files changed, 145 insertions, 0 deletions
diff --git a/net-proxy/torsocks/Manifest b/net-proxy/torsocks/Manifest
index 20c666fb793f..21b3d391175b 100644
--- a/net-proxy/torsocks/Manifest
+++ b/net-proxy/torsocks/Manifest
@@ -1,3 +1,6 @@
+AUX torsocks-2.3.0-fix-syscall.patch 2687 BLAKE2B 2ef527aa1618af20da02e2b08ddc59d2f66322c63ac0ed6245e52367124b13122ad2d6686790ef0823022bce6de53c13e4127dc97bd37d329266fe1f562c6396 SHA512 4baf4f7d8a218d255fa23004ffb9669de8938caffcb1107ff182bf8fe7c466edc32171635adb4cf69896b7cd9f3afe2ca45efedb37c2afc188568925ae9a07d6
DIST torsocks-2.2.0.tar.gz 115269 BLAKE2B e6e376dbe9b248bcb51fb0c3c16346f4888310abd6e84942acca69f67ae15afe5dfeba9a6b3a8d1fa562f87548450af93cea3bea4d899980ca6acb651658cfaa SHA512 903d11d58ece76eaf75ff8fc11a27e4a29f94be530f2d77d1a6f0982d556a4b9c78677a43eed88f2451054d0e985672900ecf73b360fa09e80195c3b9006622b
+DIST torsocks-2.3.0.tar.gz 118033 BLAKE2B a4329ffa5e20204024c4f7dda8619ba2d3e2a5f370727acdc720527688bdb3f8735b0386dfa07758fe59e1890f9ce88bb148a1b0c401bbb5966d2fe17934ca61 SHA512 139f4cf60191632add8bc845b2d68d25a0285e9746988167d832e50cedb8083f2765571429d3a11350fa2d327a1ff0a0ead9b464dac90d897b13ab948f609114
EBUILD torsocks-2.2.0.ebuild 1010 BLAKE2B 3a9fe259df34618bd7156b544051e09c13c957736803d78524bd9319328eebc408c663c732322f366dae443aa06386978d5f74e1b18e3ad3b05e96ab6d589a2d SHA512 bcb08ee5636cc37573f456c22af6e0a1b56ade236263e56a8392d2f267bf64819e80343088e8483a9353978d8d128a529a934bfdb30aba4e3caf11a1fcc01a79
+EBUILD torsocks-2.3.0.ebuild 1028 BLAKE2B 386b3080e83ab1d3deb2b95cda11fa9cc221f8ea96e482a9035c5ab27f91946f7530a891fd4b7b327682d8c446e24e0ffe00ce8f041c9031f68459687fe768de SHA512 44c3819cc1d9b1720cb487f84b3f33fb60fc81b822b3fe431991c1690deb39bb6a344e5c783c754b620d4601106caeaf5474123d79ea3c91f34be56cd5c39ae7
MISC metadata.xml 386 BLAKE2B 60d3abc672f9d331157ddadf5d3c85cd14ef1eb6762f3caad0fa53af02b430c019bd9b879ee543a1ad9b84db5053a1fe3a200429bfc0ad95299c363cd4700f8c SHA512 3ab13f567b539e1b4e8dd45fc088bb2d83abbfc161647c4f50c3a8566d13d5b14b88c851f64933ee0940ab56ae9b7cd273dd4a5e8b47faae6441a6e237ce1079
diff --git a/net-proxy/torsocks/files/torsocks-2.3.0-fix-syscall.patch b/net-proxy/torsocks/files/torsocks-2.3.0-fix-syscall.patch
new file mode 100644
index 000000000000..93eb7ad45379
--- /dev/null
+++ b/net-proxy/torsocks/files/torsocks-2.3.0-fix-syscall.patch
@@ -0,0 +1,94 @@
+From 4c00ec8773fd63fa48ef49e1ccf2adac598427be Mon Sep 17 00:00:00 2001
+From: Alejandro Alvarado <44826516+seisvelas@users.noreply.github.com>
+Date: Mon, 17 Dec 2018 19:25:18 -0600
+Subject: Add getdents / getdents64 support re ticket 28861
+
+---
+ src/common/compat.h | 8 ++++++++
+ src/lib/syscall.c | 37 +++++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+)
+
+diff --git a/src/common/compat.h b/src/common/compat.h
+index a9b73c2..d79301f 100644
+--- a/src/common/compat.h
++++ b/src/common/compat.h
+@@ -129,6 +129,12 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
+ #ifndef __NR_memfd_create
+ #define __NR_memfd_create -19
+ #endif
++#ifndef __NR_getdents
++#define __NR_getdents -20
++#endif
++#ifndef __NR_getdents64
++#define __NR_getdents64 -21
++#endif
+
+ #define TSOCKS_NR_SOCKET __NR_socket
+ #define TSOCKS_NR_CONNECT __NR_connect
+@@ -149,6 +155,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
+ #define TSOCKS_NR_CLOCK_GETTIME __NR_clock_gettime
+ #define TSOCKS_NR_FORK __NR_fork
+ #define TSOCKS_NR_MEMFD_CREATE __NR_memfd_create
++#define TSOCKS_NR_GETDENTS __NR_getdents
++#define TSOCKS_NR_GETDENTS64 __NR_getdents64
+
+ /*
+ * Despite glibc providing wrappers for these calls for a long time
+diff --git a/src/lib/syscall.c b/src/lib/syscall.c
+index 7fba580..f793da7 100644
+--- a/src/lib/syscall.c
++++ b/src/lib/syscall.c
+@@ -437,6 +437,37 @@ static LIBC_SYSCALL_RET_TYPE handle_memfd_create(va_list args)
+
+ return tsocks_libc_syscall(TSOCKS_NR_MEMFD_CREATE, name, flags);
+ }
++/*
++ * Handle getdents(2) syscall.
++ */
++static LIBC_SYSCALL_RET_TYPE handle_getdents(va_list args)
++{
++ unsigned int fd;
++ struct linux_dirent *dirp;
++ unsigned int count;
++
++ fd = va_arg(args, __typeof__(fd));
++ dirp = va_arg(args, __typeof__(dirp));
++ count = va_arg(args, __typeof__(count));
++
++ return tsocks_libc_syscall(TSOCKS_NR_GETDENTS, fd, dirp, count);
++}
++/*
++ * Handle getdents64(2) syscall.
++ */
++static LIBC_SYSCALL_RET_TYPE handle_getdents64(va_list args)
++{
++ unsigned int fd;
++ struct linux_dirent64 *dirp;
++ unsigned int count;
++
++ fd = va_arg(args, __typeof__(fd));
++ dirp = va_arg(args, __typeof__(dirp));
++ count = va_arg(args, __typeof__(count));
++
++ return tsocks_libc_syscall(TSOCKS_NR_GETDENTS64, fd, dirp, count);
++}
++
+ #endif /* __linux__ */
+
+ /*
+@@ -558,6 +589,12 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number, va_list args)
+ case TSOCKS_NR_MEMFD_CREATE:
+ ret = handle_memfd_create(args);
+ break;
++ case TSOCKS_NR_GETDENTS:
++ ret = handle_getdents(args);
++ break;
++ case TSOCKS_NR_GETDENTS64:
++ ret = handle_getdents64(args);
++ break;
+ #endif /* __linux__ */
+ default:
+ /*
+--
+cgit v1.1
+
diff --git a/net-proxy/torsocks/torsocks-2.3.0.ebuild b/net-proxy/torsocks/torsocks-2.3.0.ebuild
new file mode 100644
index 000000000000..185229c5cf7e
--- /dev/null
+++ b/net-proxy/torsocks/torsocks-2.3.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+MY_PV="$(ver_rs 3 -)"
+MY_PF="${PN}-${MY_PV}"
+S=${WORKDIR}/${MY_PF}
+
+DESCRIPTION="Use most socks-friendly applications with Tor"
+HOMEPAGE="https://github.com/dgoulet/torsocks"
+SRC_URI="https://github.com/dgoulet/torsocks/archive/v${MY_PV}.tar.gz -> ${MY_PF}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="static-libs"
+
+# We do not depend on tor which might be running on a different box
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-fix-syscall.patch )
+
+src_prepare() {
+ # Disable tests requiring network access.
+ local test
+ for test in dns fd_passing getpeername; do
+ sed -i -e "/^ test_${test} \\\\\$/d" tests/Makefile.am || \
+ die "failed to disable network tests"
+ done
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ # Remove libtool .la files
+ find "${D}" -name '*.la' -delete || die
+}