UPDATE: net/torsocks-2.2.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

UPDATE: net/torsocks-2.2.0

Gleydson Soares-3
hi,

find below a diff that brings net/torsocks to latest release 2.2.0
getpw() patch was removed along with others since those are no
longer required, new patches added to cope with #if's, and some
former patches were tweaked to reflect changes in new release.

it now requires gnu libtool, it's not able to compile by using base
libtool(1).

tests pass at least on amd64 and works fine, tested with lynx.
OK?

// gsoares



Index: Makefile
===================================================================
RCS file: /cvs/ports/net/torsocks/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile 22 Jan 2018 12:30:38 -0000 1.10
+++ Makefile 23 Jan 2018 03:10:45 -0000
@@ -2,14 +2,17 @@
 
 COMMENT = socks proxy for use with tor
 
-DISTNAME = torsocks-1.2
-REVISION = 5
+DISTNAME = torsocks-2.2.0
 
-SHARED_LIBS = torsocks 0.0 # 1.0
+GH_PROJECT = torsocks
+GH_ACCOUNT = dgoulet
+GH_TAGNAME = v2.2.0
+
+SHARED_LIBS = torsocks 1.0 # 0.0
 
 CATEGORIES = net
 
-HOMEPAGE = https://code.google.com/p/torsocks
+HOMEPAGE = https://gitweb.torproject.org/torsocks.git/
 
 MAINTAINER = Pascal Stumpf <[hidden email]>
 
@@ -18,7 +21,13 @@ PERMIT_PACKAGE_CDROM = Yes
 
 WANTLIB += pthread
 
-MASTER_SITES = ${MASTER_SITE_GOOGLECODE:=torsocks/}
+AUTOCONF_VERSION= 2.69
+AUTOMAKE_VERSION= 1.15
+
+BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \
+ ${MODGNU_AUTOMAKE_DEPENDS}
+
+USE_LIBTOOL = gnu
 
 RUN_DEPENDS = net/tor
 
@@ -26,9 +35,13 @@ FAKE_FLAGS = CONFDIR=${PREFIX}/share/ex
 
 CONFIGURE_STYLE = gnu
 
-NO_TEST = Yes
+pre-patch:
+ cd ${WRKSRC} && \
+ AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+ AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./autogen.sh
 
 pre-configure:
- ${SUBST_CMD} ${WRKSRC}/src/torsocks.in
+ ${SUBST_CMD} ${WRKSRC}/src/bin/torsocks.in
+
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/torsocks/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo 18 Jan 2015 03:14:53 -0000 1.2
+++ distinfo 23 Jan 2018 03:10:45 -0000
@@ -1,2 +1,2 @@
-SHA256 (torsocks-1.2.tar.gz) = vqV9NiTXI3JP0eJg8Oayo1TA2nQsAjqplMdpInDREdQ=
-SIZE (torsocks-1.2.tar.gz) = 456453
+SHA256 (torsocks-2.2.0.tar.gz) = NiFqHjD0f6DlvoR2Hg1yEzGWyKBCcWAX2lbpQ5M4yH0=
+SIZE (torsocks-2.2.0.tar.gz) = 115269
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_in 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+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
+
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 1 Dec 2011 11:49:27 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-configure,v 1.1.1.1 2011/12/01 11:49:27 pascal Exp $
---- configure.orig Mon Oct 24 22:23:40 2011
-+++ configure Sun Oct 30 17:07:11 2011
-@@ -4827,7 +4827,6 @@ fi
- fi
-
-
--$as_echo "#define SUPPORT_RES_API /**/" >>confdefs.h
-
-
-
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: /cvs/ports/net/torsocks/patches/patch-doc_Makefile_in,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in 1 Dec 2011 11:49:27 -0000 1.1.1.1
+++ patches/patch-doc_Makefile_in 23 Jan 2018 03:10:45 -0000
@@ -1,11 +1,13 @@
-$OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2011/12/01 11:49:27 pascal Exp $
---- doc/Makefile.in.orig Tue Nov  8 14:46:24 2011
-+++ doc/Makefile.in Tue Nov  8 14:46:38 2011
-@@ -517,7 +517,7 @@ info: info-am
+$OpenBSD$
+
+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_dataDATA \
+-install-data-am: install-dist_confDATA install-dist_docDATA \
 +install-data-am: install-dist_confDATA \
  install-man
 
Index: patches/patch-src_bin_torsocks_in
===================================================================
RCS file: patches/patch-src_bin_torsocks_in
diff -N patches/patch-src_bin_torsocks_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_bin_torsocks_in 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,141 @@
+$OpenBSD$
+
+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@
+ 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)
Index: patches/patch-src_common_compat_c
===================================================================
RCS file: patches/patch-src_common_compat_c
diff -N patches/patch-src_common_compat_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_common_compat_c 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Index: src/common/compat.c
+--- src/common/compat.c.orig
++++ src/common/compat.c
+@@ -20,7 +20,8 @@
+ #include "compat.h"
+
+ #if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
+- defined(__darwin__) || defined(__NetBSD__))
++ 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
+ tsocks_mutex_unlock(&o->mutex);
+ }
+
+-#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__, __OpenBSD__ */
Index: patches/patch-src_common_compat_h
===================================================================
RCS file: patches/patch-src_common_compat_h
diff -N patches/patch-src_common_compat_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_common_compat_h 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,43 @@
+$OpenBSD$
+
+Index: src/common/compat.h
+--- src/common/compat.h.orig
++++ src/common/compat.h
+@@ -23,7 +23,8 @@
+ #endif
+
+ #if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
+- defined(__darwin__) || defined(__NetBSD__))
++ defined(__darwin__) || defined(__NetBSD__) || \
++ defined(__OpenBSD__))
+
+ #ifndef RTLD_NEXT
+ #define RTLD_NEXT ((void *) -1)
+@@ -58,7 +59,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine
+
+ #else
+ #error "OS not supported."
+-#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__, __OpenBSD__ */
+
+ #if defined(__linux__)
+ #include <unistd.h>
+@@ -176,7 +177,8 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine
+
+ #endif /* __linux__ */
+
+-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__darwin__) || \
++ defined(__NetBSD__) || defined(__OpenBSD__))
+
+ #include <sys/syscall.h>
+ #include <unistd.h>
+@@ -195,7 +197,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine
+ #define TSOCKS_NR_LISTEN    SYS_listen
+ #define TSOCKS_NR_RECVMSG   SYS_recvmsg
+
+-#endif /* __FreeBSD__, __FreeBSD_kernel__, __darwin__, __NetBSD__ */
++#endif /* __FreeBSD__, __FreeBSD_kernel__, __darwin__, __NetBSD__, __OpenBSD__ */
+
+ #define TSOCKS_CLASSA_NET   0xff000000
+ #define TSOCKS_LOOPBACK_NET 0x7f000000
Index: patches/patch-src_common_defaults_h
===================================================================
RCS file: patches/patch-src_common_defaults_h
diff -N patches/patch-src_common_defaults_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_common_defaults_h 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/common/defaults.h
+--- src/common/defaults.h.orig
++++ src/common/defaults.h
+@@ -39,7 +39,7 @@
+ #define DEFAULT_DOMAIN_NAME_SIZE 255
+
+ #define DEFAULT_CONF_FILENAME "torsocks.conf"
+-#define DEFAULT_CONF_FILE CONFDIR "/tor/" DEFAULT_CONF_FILENAME
++#define DEFAULT_CONF_FILE CONFDIR "/" DEFAULT_CONF_FILENAME
+ #define DEFAULT_CONF_FILE_ENV "TORSOCKS_CONF_FILE"
+
+ /*
Index: patches/patch-src_common_ref_h
===================================================================
RCS file: patches/patch-src_common_ref_h
diff -N patches/patch-src_common_ref_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_common_ref_h 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Index: src/common/ref.h
+--- src/common/ref.h.orig
++++ src/common/ref.h
+@@ -27,7 +27,7 @@ struct ref {
+ };
+
+ #if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
+- defined(__darwin__) || defined(__NetBSD__))
++ defined(__darwin__) || defined(__NetBSD__) || defined(__OpenBSD__))
+
+ /*
+  * Get a reference by incrementing the refcount.
+@@ -58,6 +58,6 @@ static inline void ref_put(struct ref *r,
+
+ #else
+ #error "OS not supported"
+-#endif /* __linux__, __GLIBC__, __FreeBSD__, __darwin__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__, __FreeBSD__, __darwin__, __NetBSD__, __OpenBSD__ */
+
+ #endif /* TORSOCKS_REF_H */
Index: patches/patch-src_lib_syscall_c
===================================================================
RCS file: patches/patch-src_lib_syscall_c
diff -N patches/patch-src_lib_syscall_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_lib_syscall_c 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,58 @@
+$OpenBSD$
+
+Index: src/lib/syscall.c
+--- src/lib/syscall.c.orig
++++ src/lib/syscall.c
+@@ -84,7 +84,8 @@ static LIBC_ACCEPT_RET_TYPE handle_accept(va_list args
+ return tsocks_accept(sockfd, addr, &addrlen);
+ }
+
+-#if (defined(__linux__) || defined(__darwin__) || (defined(__FreeBSD_kernel__) && defined(__i386__)) || defined(__NetBSD__))
++#if (defined(__linux__) || defined(__darwin__) || (defined(__FreeBSD_kernel__) && \
++ defined(__i386__)) || defined(__NetBSD__) || defined(__OpenBSD__))
+ /*
+  * Handle mmap(2) syscall.
+  */
+@@ -104,7 +105,7 @@ static LIBC_SYSCALL_RET_TYPE handle_mmap(va_list args)
+
+ return (LIBC_SYSCALL_RET_TYPE) mmap(addr, len, prot, flags, fd, offset);
+ }
+-#endif /* __linux__, __darwin__, __FreeBSD_kernel__, __i386__, __NetBSD__ */
++#endif /* __linux__, __darwin__, __FreeBSD_kernel__, __i386__, __NetBSD__, __OpenBSD__ */
+
+ /*
+  * Handle munmap(2) syscall.
+@@ -392,7 +393,8 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number,
+ ret = handle_close(args);
+ break;
+ case TSOCKS_NR_MMAP:
+-#if (defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(__x86_64)
++#if (defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
++ defined(__OpenBSD__) && defined(__x86_64))
+ /*
+ * On an 64 bit *BSD system, __syscall(2) should be used for mmap().
+ * This is NOT suppose to happen but for protection we deny that call.
+@@ -421,7 +423,7 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number,
+ * own memory using mmap() called by syscall(). Same for munmap().
+ */
+ ret = handle_mmap(args);
+-#endif /* __NetBSD__, __FreeBSD__, __FreeBSD_kernel__, __x86_64 */
++#endif /* __NetBSD__, __FreeBSD__, __FreeBSD_kernel__, __x86_64, __OpenBSD__ */
+ break;
+ case TSOCKS_NR_MUNMAP:
+ ret = handle_munmap(args);
+@@ -516,7 +518,7 @@ LIBC_SYSCALL_DECL
+ }
+
+ /* Only used for *BSD systems. */
+-#if (defined(__NetBSD__) || defined(__FreeBSD__))
++#if (defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__))
+
+ /* __syscall(2) */
+ TSOCKS_LIBC_DECL(__syscall, LIBC___SYSCALL_RET_TYPE, LIBC___SYSCALL_SIG)
+@@ -580,4 +582,4 @@ LIBC___SYSCALL_DECL
+ return ret;
+ }
+
+-#endif /* __NetBSD__, __FreeBSD__ */
++#endif /* __NetBSD__, __FreeBSD__, __OpenBSD__ */
Index: patches/patch-src_lib_torsocks_h
===================================================================
RCS file: patches/patch-src_lib_torsocks_h
diff -N patches/patch-src_lib_torsocks_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_lib_torsocks_h 23 Jan 2018 03:10:45 -0000
@@ -0,0 +1,75 @@
+$OpenBSD$
+
+Index: src/lib/torsocks.h
+--- src/lib/torsocks.h.orig
++++ src/lib/torsocks.h
+@@ -36,7 +36,8 @@
+ extern type tsocks_##name(sig);
+
+ #if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
+- defined(__darwin__) || defined(__NetBSD__))
++ defined(__darwin__) || defined(__NetBSD__) || \
++ defined(__OpenBSD__))
+
+ #ifdef __NetBSD__
+ #include <sys/param.h> /* __NetBSD_Version__ */
+@@ -231,7 +232,7 @@ struct hostent **result, int *h_errnop
+
+ #else
+ #error "OS not supported."
+-#endif /* __linux__, __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
++#endif /* __linux__, __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__, __OpenBSD__ */
+
+ #if (defined(__linux__))
+
+@@ -252,7 +253,8 @@ struct hostent **result, int *h_errnop
+
+ #endif /* __linux__ */
+
+-#if (defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
++#if (defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__) || \
++ defined(__OpenBSD__))
+
+ /* syscall(2) */
+ #define LIBC_SYSCALL_NAME syscall
+@@ -261,7 +263,7 @@ struct hostent **result, int *h_errnop
+ #define LIBC_SYSCALL_SIG int number, ...
+ #define LIBC_SYSCALL_ARGS number
+
+-#endif /* __FreeBSD__, __darwin__, __NetBSD__ */
++#endif /* __FreeBSD__, __darwin__, __NetBSD__, __OpenBSD__ */
+
+ #if (defined(__linux__) || defined(__GLIBC__)) && defined(__FreeBSD_kernel__)
+
+@@ -283,7 +285,7 @@ struct hostent **result, int *h_errnop
+ #define LIBC___SYSCALL_SIG quad_t number, ...
+ #define LIBC___SYSCALL_ARGS number
+
+-#elif defined(__NetBSD__)
++#elif (defined(__NetBSD__) || defined(__OpenBSD__))
+
+ #define LIBC___SYSCALL_NAME __syscall
+ #define LIBC___SYSCALL_NAME_STR XSTR(LIBC___SYSCALL_NAME)
+@@ -291,7 +293,7 @@ struct hostent **result, int *h_errnop
+ #define LIBC___SYSCALL_SIG quad_t number, ...
+ #define LIBC___SYSCALL_ARGS number
+
+-#endif /* __FreeBSD__, __NetBSD__ */
++#endif /* __FreeBSD__, __NetBSD__, __OpenBSD__ */
+
+ /*
+  * The following defines are libc function declarations using the macros
+@@ -334,11 +336,11 @@ extern TSOCKS_LIBC_DECL(syscall, LIBC_SYSCALL_RET_TYPE
+ LIBC_SYSCALL_RET_TYPE LIBC_SYSCALL_NAME(LIBC_SYSCALL_SIG)
+
+ /* __syscall(2) */
+-#if (defined(__FreeBSD__) || defined(__NetBSD__))
++#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
+ extern TSOCKS_LIBC_DECL(__syscall, LIBC___SYSCALL_RET_TYPE, LIBC___SYSCALL_SIG)
+ #define LIBC___SYSCALL_DECL \
+ LIBC___SYSCALL_RET_TYPE LIBC___SYSCALL_NAME(LIBC___SYSCALL_SIG)
+-#endif /* __FreeBSD__, __NetBSD__ */
++#endif /* __FreeBSD__, __NetBSD__, __OpenBSD__ */
+
+ /* close(2) */
+ extern TSOCKS_LIBC_DECL(close, LIBC_CLOSE_RET_TYPE, LIBC_CLOSE_SIG)
Index: patches/patch-src_socks_c
===================================================================
RCS file: patches/patch-src_socks_c
diff -N patches/patch-src_socks_c
--- patches/patch-src_socks_c 22 Jan 2018 12:30:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-$OpenBSD: patch-src_socks_c,v 1.1 2018/01/22 12:30:38 sthen Exp $
-
-Index: src/socks.c
---- src/socks.c.orig
-+++ src/socks.c
-@@ -281,7 +281,7 @@ static int send_socksv4a_request(struct connreq *conn,
-     struct sockreq *thisreq;
-     int endOfUser;
-     /* Determine the current username */
--    user = getpwuid(getuid());
-+    user = NULL;
-
-     thisreq = (struct sockreq *) conn->buffer;
-     endOfUser=sizeof(struct sockreq) +
-@@ -324,7 +324,7 @@ static int send_socksv4_request(struct connreq *conn)
-     struct sockreq *thisreq;
-
-     /* Determine the current username */
--    user = getpwuid(getuid());
-+    user = NULL;
-
-     thisreq = (struct sockreq *) conn->buffer;
-
-@@ -493,7 +493,7 @@ static int read_socksv5_method(struct connreq *conn)
-         show_msg(MSGDEBUG, "SOCKS V5 server chose username/password authentication\n");
-
-         /* Determine the current *nix username */
--        nixuser = getpwuid(getuid());
-+        nixuser = NULL;
-
-         if (((uname = conn->path->defuser) == NULL) &&
-           ((uname = getenv("TORSOCKS_USERNAME")) == NULL) &&
Index: patches/patch-src_torsocks_in
===================================================================
RCS file: patches/patch-src_torsocks_in
diff -N patches/patch-src_torsocks_in
--- patches/patch-src_torsocks_in 4 Nov 2015 16:05:51 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-$OpenBSD: patch-src_torsocks_in,v 1.2 2015/11/04 16:05:51 giovanni Exp $
---- src/torsocks.in.orig Sun Oct 23 23:12:13 2011
-+++ src/torsocks.in Sun Nov  1 22:34:25 2015
-@@ -76,7 +76,7 @@ fi
- LIBDIR="@prefix@/lib/torsocks"
- LIB_NAME="libtorsocks"
- SHLIB_EXT="@SHLIB_EXT@"
--SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}"
-+SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}.${LIBtorsocks_VERSION}"
-
- # Ensure libtorsocks exists,
- if [ ! -f $SHLIB ]; then
-@@ -101,7 +101,7 @@ case "$1" in
-     #replace '/' with '\/' in @prefix@
-     # escprefix=`echo '@prefix@' |sed 's/\\//\\\\\//g'`
-     # export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s/$escprefix\/lib\/torsocks\/libtorsocks.so \?//"`
--    export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s#@prefix@/lib/torsocks/libtorsocks\.@SHLIB_EXT@ *##"`
-+    export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s#@prefix@/lib/torsocks/libtorsocks\.@SHLIB_EXT@\.${LIBtorsocks_VERSION} *##"`
-     if [ -z "$@LDPRELOAD@" ]
-       then
-         unset @LDPRELOAD@
Index: patches/patch-test_Makefile_in
===================================================================
RCS file: patches/patch-test_Makefile_in
diff -N patches/patch-test_Makefile_in
--- patches/patch-test_Makefile_in 1 Dec 2011 11:49:27 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-test_Makefile_in,v 1.1.1.1 2011/12/01 11:49:27 pascal Exp $
---- test/Makefile.in.orig Tue Nov  8 14:53:21 2011
-+++ test/Makefile.in Tue Nov  8 14:53:31 2011
-@@ -458,7 +458,7 @@ info: info-am
-
- info-am:
-
--install-data-am: install-dist_dataDATA
-+install-data-am:
-
- install-dvi: install-dvi-am
-
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/torsocks/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 16 Mar 2015 18:07:53 -0000 1.2
+++ pkg/PLIST 23 Jan 2018 03:10:45 -0000
@@ -1,14 +1,13 @@
 @comment $OpenBSD: PLIST,v 1.2 2015/03/16 18:07:53 naddy Exp $
 bin/torsocks
-bin/usewithtor
 lib/torsocks/
 lib/torsocks/libtorsocks.a
 lib/torsocks/libtorsocks.la
 @lib lib/torsocks/libtorsocks.so.${LIBtorsocks_VERSION}
 @man man/man1/torsocks.1
-@man man/man1/usewithtor.1
 @man man/man5/torsocks.conf.5
 @man man/man8/torsocks.8
 share/examples/torsocks/
-share/examples/torsocks/torsocks.conf
+share/examples/torsocks/tor/
+share/examples/torsocks/tor/torsocks.conf
 @sample ${SYSCONFDIR}/torsocks.conf