1 |
commit: 2b134ba23299a635f3ff4056aa75bebdaaca93f3 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 3 13:57:24 2019 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 3 13:57:24 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b134ba2 |
7 |
|
8 |
net-proxy/torsocks: version bump to 2.3.0, bug #680502 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/680502 |
11 |
Package-Manager: Portage-2.3.76, Repoman-2.3.16 |
12 |
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org> |
13 |
|
14 |
net-proxy/torsocks/Manifest | 1 + |
15 |
.../files/torsocks-2.3.0-fix-syscall.patch | 94 ++++++++++++++++++++++ |
16 |
net-proxy/torsocks/torsocks-2.3.0.ebuild | 48 +++++++++++ |
17 |
3 files changed, 143 insertions(+) |
18 |
|
19 |
diff --git a/net-proxy/torsocks/Manifest b/net-proxy/torsocks/Manifest |
20 |
index e91855d4925..8c6d485bcea 100644 |
21 |
--- a/net-proxy/torsocks/Manifest |
22 |
+++ b/net-proxy/torsocks/Manifest |
23 |
@@ -1 +1,2 @@ |
24 |
DIST torsocks-2.2.0.tar.gz 115269 BLAKE2B e6e376dbe9b248bcb51fb0c3c16346f4888310abd6e84942acca69f67ae15afe5dfeba9a6b3a8d1fa562f87548450af93cea3bea4d899980ca6acb651658cfaa SHA512 903d11d58ece76eaf75ff8fc11a27e4a29f94be530f2d77d1a6f0982d556a4b9c78677a43eed88f2451054d0e985672900ecf73b360fa09e80195c3b9006622b |
25 |
+DIST torsocks-2.3.0.tar.gz 118033 BLAKE2B a4329ffa5e20204024c4f7dda8619ba2d3e2a5f370727acdc720527688bdb3f8735b0386dfa07758fe59e1890f9ce88bb148a1b0c401bbb5966d2fe17934ca61 SHA512 139f4cf60191632add8bc845b2d68d25a0285e9746988167d832e50cedb8083f2765571429d3a11350fa2d327a1ff0a0ead9b464dac90d897b13ab948f609114 |
26 |
|
27 |
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 |
28 |
new file mode 100644 |
29 |
index 00000000000..93eb7ad4537 |
30 |
--- /dev/null |
31 |
+++ b/net-proxy/torsocks/files/torsocks-2.3.0-fix-syscall.patch |
32 |
@@ -0,0 +1,94 @@ |
33 |
+From 4c00ec8773fd63fa48ef49e1ccf2adac598427be Mon Sep 17 00:00:00 2001 |
34 |
+From: Alejandro Alvarado <44826516+seisvelas@××××××××××××××××××××.com> |
35 |
+Date: Mon, 17 Dec 2018 19:25:18 -0600 |
36 |
+Subject: Add getdents / getdents64 support re ticket 28861 |
37 |
+ |
38 |
+--- |
39 |
+ src/common/compat.h | 8 ++++++++ |
40 |
+ src/lib/syscall.c | 37 +++++++++++++++++++++++++++++++++++++ |
41 |
+ 2 files changed, 45 insertions(+) |
42 |
+ |
43 |
+diff --git a/src/common/compat.h b/src/common/compat.h |
44 |
+index a9b73c2..d79301f 100644 |
45 |
+--- a/src/common/compat.h |
46 |
++++ b/src/common/compat.h |
47 |
+@@ -129,6 +129,12 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void)); |
48 |
+ #ifndef __NR_memfd_create |
49 |
+ #define __NR_memfd_create -19 |
50 |
+ #endif |
51 |
++#ifndef __NR_getdents |
52 |
++#define __NR_getdents -20 |
53 |
++#endif |
54 |
++#ifndef __NR_getdents64 |
55 |
++#define __NR_getdents64 -21 |
56 |
++#endif |
57 |
+ |
58 |
+ #define TSOCKS_NR_SOCKET __NR_socket |
59 |
+ #define TSOCKS_NR_CONNECT __NR_connect |
60 |
+@@ -149,6 +155,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void)); |
61 |
+ #define TSOCKS_NR_CLOCK_GETTIME __NR_clock_gettime |
62 |
+ #define TSOCKS_NR_FORK __NR_fork |
63 |
+ #define TSOCKS_NR_MEMFD_CREATE __NR_memfd_create |
64 |
++#define TSOCKS_NR_GETDENTS __NR_getdents |
65 |
++#define TSOCKS_NR_GETDENTS64 __NR_getdents64 |
66 |
+ |
67 |
+ /* |
68 |
+ * Despite glibc providing wrappers for these calls for a long time |
69 |
+diff --git a/src/lib/syscall.c b/src/lib/syscall.c |
70 |
+index 7fba580..f793da7 100644 |
71 |
+--- a/src/lib/syscall.c |
72 |
++++ b/src/lib/syscall.c |
73 |
+@@ -437,6 +437,37 @@ static LIBC_SYSCALL_RET_TYPE handle_memfd_create(va_list args) |
74 |
+ |
75 |
+ return tsocks_libc_syscall(TSOCKS_NR_MEMFD_CREATE, name, flags); |
76 |
+ } |
77 |
++/* |
78 |
++ * Handle getdents(2) syscall. |
79 |
++ */ |
80 |
++static LIBC_SYSCALL_RET_TYPE handle_getdents(va_list args) |
81 |
++{ |
82 |
++ unsigned int fd; |
83 |
++ struct linux_dirent *dirp; |
84 |
++ unsigned int count; |
85 |
++ |
86 |
++ fd = va_arg(args, __typeof__(fd)); |
87 |
++ dirp = va_arg(args, __typeof__(dirp)); |
88 |
++ count = va_arg(args, __typeof__(count)); |
89 |
++ |
90 |
++ return tsocks_libc_syscall(TSOCKS_NR_GETDENTS, fd, dirp, count); |
91 |
++} |
92 |
++/* |
93 |
++ * Handle getdents64(2) syscall. |
94 |
++ */ |
95 |
++static LIBC_SYSCALL_RET_TYPE handle_getdents64(va_list args) |
96 |
++{ |
97 |
++ unsigned int fd; |
98 |
++ struct linux_dirent64 *dirp; |
99 |
++ unsigned int count; |
100 |
++ |
101 |
++ fd = va_arg(args, __typeof__(fd)); |
102 |
++ dirp = va_arg(args, __typeof__(dirp)); |
103 |
++ count = va_arg(args, __typeof__(count)); |
104 |
++ |
105 |
++ return tsocks_libc_syscall(TSOCKS_NR_GETDENTS64, fd, dirp, count); |
106 |
++} |
107 |
++ |
108 |
+ #endif /* __linux__ */ |
109 |
+ |
110 |
+ /* |
111 |
+@@ -558,6 +589,12 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number, va_list args) |
112 |
+ case TSOCKS_NR_MEMFD_CREATE: |
113 |
+ ret = handle_memfd_create(args); |
114 |
+ break; |
115 |
++ case TSOCKS_NR_GETDENTS: |
116 |
++ ret = handle_getdents(args); |
117 |
++ break; |
118 |
++ case TSOCKS_NR_GETDENTS64: |
119 |
++ ret = handle_getdents64(args); |
120 |
++ break; |
121 |
+ #endif /* __linux__ */ |
122 |
+ default: |
123 |
+ /* |
124 |
+-- |
125 |
+cgit v1.1 |
126 |
+ |
127 |
|
128 |
diff --git a/net-proxy/torsocks/torsocks-2.3.0.ebuild b/net-proxy/torsocks/torsocks-2.3.0.ebuild |
129 |
new file mode 100644 |
130 |
index 00000000000..185229c5cf7 |
131 |
--- /dev/null |
132 |
+++ b/net-proxy/torsocks/torsocks-2.3.0.ebuild |
133 |
@@ -0,0 +1,48 @@ |
134 |
+# Copyright 1999-2019 Gentoo Authors |
135 |
+# Distributed under the terms of the GNU General Public License v2 |
136 |
+ |
137 |
+EAPI=7 |
138 |
+ |
139 |
+inherit autotools |
140 |
+ |
141 |
+MY_PV="$(ver_rs 3 -)" |
142 |
+MY_PF="${PN}-${MY_PV}" |
143 |
+S=${WORKDIR}/${MY_PF} |
144 |
+ |
145 |
+DESCRIPTION="Use most socks-friendly applications with Tor" |
146 |
+HOMEPAGE="https://github.com/dgoulet/torsocks" |
147 |
+SRC_URI="https://github.com/dgoulet/torsocks/archive/v${MY_PV}.tar.gz -> ${MY_PF}.tar.gz" |
148 |
+ |
149 |
+LICENSE="GPL-2" |
150 |
+SLOT="0" |
151 |
+KEYWORDS="~amd64 ~arm ~x86" |
152 |
+IUSE="static-libs" |
153 |
+ |
154 |
+# We do not depend on tor which might be running on a different box |
155 |
+DEPEND="" |
156 |
+RDEPEND="${DEPEND}" |
157 |
+ |
158 |
+PATCHES=( "${FILESDIR}"/${P}-fix-syscall.patch ) |
159 |
+ |
160 |
+src_prepare() { |
161 |
+ # Disable tests requiring network access. |
162 |
+ local test |
163 |
+ for test in dns fd_passing getpeername; do |
164 |
+ sed -i -e "/^ test_${test} \\\\\$/d" tests/Makefile.am || \ |
165 |
+ die "failed to disable network tests" |
166 |
+ done |
167 |
+ |
168 |
+ default |
169 |
+ eautoreconf |
170 |
+} |
171 |
+ |
172 |
+src_configure() { |
173 |
+ econf $(use_enable static-libs static) |
174 |
+} |
175 |
+ |
176 |
+src_install() { |
177 |
+ default |
178 |
+ |
179 |
+ # Remove libtool .la files |
180 |
+ find "${D}" -name '*.la' -delete || die |
181 |
+} |