aboutsummaryrefslogtreecommitdiff
path: root/net/torsocks
diff options
context:
space:
mode:
authorBeat Gaetzi <beat@FreeBSD.org>2009-03-08 13:57:27 +0000
committerBeat Gaetzi <beat@FreeBSD.org>2009-03-08 13:57:27 +0000
commitc051a2080a4b2844e2ba6b8c5df4515f80d7840b (patch)
tree9517a26b8ce40b64a0983e37d205a3b94c59c3b4 /net/torsocks
parent335d471aee9ca16f5700d233abdc134186924fef (diff)
It is new generation of TSOCKS.
Torsocks allows you to use most socks-friendly applications in a safe way with Tor. It ensures that DNS requests are handled safely and explicitly rejects UDP traffic from the application you're using. WWW: http://code.google.com/p/torsocks/ PR: ports/131653 Submitted by: Andrei Lavreniyuk <andy.lavr AT gmail.com> Approved by: miwi (mentor)
Notes
Notes: svn path=/head/; revision=229676
Diffstat (limited to 'net/torsocks')
-rw-r--r--net/torsocks/Makefile128
-rw-r--r--net/torsocks/distinfo3
-rw-r--r--net/torsocks/files/patch-Makefile.am21
-rw-r--r--net/torsocks/files/patch-configure.in70
-rw-r--r--net/torsocks/files/patch-torsocks.in37
-rw-r--r--net/torsocks/files/patch-tsocks.c11
-rw-r--r--net/torsocks/files/patch-usewithtor.in16
-rw-r--r--net/torsocks/files/pkg-message.in12
-rw-r--r--net/torsocks/pkg-descr8
-rw-r--r--net/torsocks/pkg-plist12
10 files changed, 318 insertions, 0 deletions
diff --git a/net/torsocks/Makefile b/net/torsocks/Makefile
new file mode 100644
index 000000000000..3cad36d3e6af
--- /dev/null
+++ b/net/torsocks/Makefile
@@ -0,0 +1,128 @@
+# New ports collection makefile for: torsocks
+# Date created: 13 February 2009
+# Whom: Andrei Lavreniyuk <andy.lavr@gmail.com>
+#
+# $FreeBSD$
+
+PORTNAME= torsocks
+PORTVERSION= 1.0
+CATEGORIES= net security
+MASTER_SITES= GOOGLE_CODE \
+ http://tor.reactor-xg.kiev.ua/files/
+DISTNAME= ${PORTNAME}-${PORTVERSION}-gamma
+
+MAINTAINER= andy.lavr@gmail.com
+COMMENT= Most SOCKS-friendly applications way with Tor
+
+USE_AUTOTOOLS= libtool:15 aclocal:110 autoconf:262
+ACLOCAL_ARGS= -I ${LOCALBASE}/share/aclocal
+
+USE_GMAKE= yes
+USE_LDCONFIG= yes
+
+MAN1= torsocks.1 usewithtor.1
+MAN5= torsocks.conf.5
+MAN8= torsocks.8
+
+SUB_FILES= pkg-message
+
+OPTIONS= TORDNS "Use tordns" on \
+ SOCKSDNS "Use socks server for DNS lookups" off \
+ OLDMETHOD "Do not use RTLD_NEXT parameter to dlsym" off \
+ NODEBUG "Disable output of error messages" off \
+ HOSTNAMES "Disable DNS lookups of socks server" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITHOUT_TORDNS)
+CONFIGURE_ARGS+= --disable-tordns
+.endif
+
+.if defined(WITH_SOCKSDNS)
+CONFIGURE_ARGS+= --enable-socksdns
+.endif
+
+.if defined(WITH_OLDMETHOD)
+CONFIGURE_ARGS+= --enable-oldmethod
+.endif
+
+.if defined(WITH_NODEBUG)
+CONFIGURE_ARGS+= --disable-debug
+.endif
+
+.if defined(WITH_HOSTNAMES)
+CONFIGURE_ARGS+= --enable-hostnames
+.endif
+
+.if defined(WITH_SOCKSDNS) && !defined(WITH_HOSTNAMES)
+BROKEN= HOSTNAMES option is necessary if SOCKSDNS option is enabled
+.endif
+
+pre-everything::
+.if !defined(WITHOUT_TORDNS)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can deselect the TORDNS option."
+ @${ECHO_MSG} "This option disables tordns, which causes"
+ @${ECHO_MSG} "names to be looked up in a way designed to"
+ @${ECHO_MSG} "work well with Tor."
+ @${ECHO_MSG}
+.endif
+
+.if !defined(WITH_SOCKSDNS)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can use the SOCKSDNS option."
+ @${ECHO_MSG} "This option causes torsocks to intercept"
+ @${ECHO_MSG} "DNS lookups and attempt to force them"
+ @${ECHO_MSG} "to use TCP instead of UDP and thus"
+ @${ECHO_MSG} "be proxied through the socks server."
+ @${ECHO_MSG}
+.endif
+
+.if !defined(WITH_OLDMETHOD)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can use the OLDMETHOD option."
+ @${ECHO_MSG} "This forces torsocks not to use the"
+ @${ECHO_MSG} "RTLD_NEXT parameter to dlsym to get the"
+ @${ECHO_MSG} "address of the connect() method torsocks"
+ @${ECHO_MSG} "overrides, instead it loads a reference"
+ @${ECHO_MSG} "to the libc shared library and then uses dlsym()."
+ @${ECHO_MSG}
+.endif
+
+.if !defined(WITH_NODEBUG)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can use the NODEBUG option."
+ @${ECHO_MSG} "This configuration option tells torsocks"
+ @${ECHO_MSG} "to never output error messages to stderr."
+ @${ECHO_MSG}
+.endif
+
+.if !defined(WITH_HOSTNAMES)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can use the HOSTNAMES option."
+ @${ECHO_MSG} "This disables DNS lookups on names"
+ @${ECHO_MSG} "provided as socks servers in the config"
+ @${ECHO_MSG} "file. This option is necessary"
+ @${ECHO_MSG} "if socks dns is enabled since torsocks"
+ @${ECHO_MSG} "can't send a socks dns request to resolve"
+ @${ECHO_MSG} "the location of the socks server."
+ @${ECHO_MSG}
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|@prefix@|${PREFIX}|' ${WRKSRC}/src/torsocks.in
+ @${REINPLACE_CMD} -e 's|MAP_ANONYMOUS|MAP_ANON|' ${WRKSRC}/src/dead_pool.c
+ @${MV} ${WRKSRC}/src/torsocks.conf ${WRKSRC}/src/torsocks.conf.sample
+
+post-install:
+.if !defined(NOPORTEXAMPLES)
+ @${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/src/*.example ${EXAMPLESDIR}
+.endif
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR}
+.endif
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/net/torsocks/distinfo b/net/torsocks/distinfo
new file mode 100644
index 000000000000..0991e629f985
--- /dev/null
+++ b/net/torsocks/distinfo
@@ -0,0 +1,3 @@
+MD5 (torsocks-1.0-gamma.tar.gz) = a55f99cf78654a990d0646fc767567ca
+SHA256 (torsocks-1.0-gamma.tar.gz) = d13dbd7d97745ecac6cf3ecc3800535faa3c08f5b9b33f214e210afd7658aae6
+SIZE (torsocks-1.0-gamma.tar.gz) = 482415
diff --git a/net/torsocks/files/patch-Makefile.am b/net/torsocks/files/patch-Makefile.am
new file mode 100644
index 000000000000..c23f3dbe80b3
--- /dev/null
+++ b/net/torsocks/files/patch-Makefile.am
@@ -0,0 +1,21 @@
+--- src/Makefile.am.orig 2009-02-07 11:48:12.000000000 +0100
++++ src/Makefile.am 2009-02-18 17:29:26.000000000 +0100
+@@ -1,7 +1,7 @@
+ # Makefile used by configure to create real Makefile
+
+-LIBS = -ldl -lc -lresolv
+-libdir = @prefix@/lib/torsocks
++LIBS = -lc
++libdir = @prefix@/lib
+
+ # Install helper programs
+ #bin_PROGRAMS = validateconf inspectsocks saveme
+@@ -16,7 +16,7 @@
+
+ # Install configuration file
+ usewithtorconfdir = $(CONFDIR)/
+-usewithtorconf_DATA = torsocks.conf
++usewithtorconf_DATA = torsocks.conf.sample
+
+ # Install invocation scripts
+ bin_SCRIPTS = torsocks usewithtor
diff --git a/net/torsocks/files/patch-configure.in b/net/torsocks/files/patch-configure.in
new file mode 100644
index 000000000000..17953f5bc85a
--- /dev/null
+++ b/net/torsocks/files/patch-configure.in
@@ -0,0 +1,70 @@
+--- configure.in.orig 2009-02-12 15:59:50.000000000 +0200
++++ configure.in 2009-02-12 17:27:16.000000000 +0200
+@@ -123,11 +123,9 @@
+ dnl Checks for libraries.
+ dnl Replace `main' with a function in -ldl:
+
+-AC_CHECK_LIB(dl, dlsym, [ tempdso="yes" ],tempdso="no")
+-if test "$tempdso" = "no"; then
+- AC_CHECK_LIB(c, dlsym,,AC_MSG_ERROR("dlsym() not found in libc or libdl." \
+- "Check your system for libc.so and/or libdl.so."))
+-fi
++dnl Checks for libraries.
++AC_CHECK_LIB(c, dlsym,,AC_MSG_ERROR(""dlsym() not found in libc." \
++ "Check your system for libc.so."))
+
+ AC_CHECK_LIB(resolv, res_query, [ tempres="no" ],tempres="yes")
+ if test "$tempres" = "no"; then
+@@ -356,8 +354,8 @@
+ dnl Find the correct res_querydomain prototype on this machine
+ AC_MSG_CHECKING(for correct res_querydomain prototype)
+ PROTO=
+-PROTO1='const char *name, const char *domain, int class, int type, unsigned char *answer, int anslen'
+-for testproto in "${PROTO1}"
++PROTO1='const char *name, const char *domain, int class, int type, u_char *answer, int anslen'
++for PROTO in "${PROTO1}"
+ do
+ if test "${PROTO}" = ""; then
+ AC_TRY_COMPILE([
+@@ -376,8 +374,8 @@
+ AC_MSG_CHECKING(for correct res_send prototype)
+ PROTO=
+ PROTO1='const char *msg, int msglen, char *answer, int anslen'
+-PROTO2='const unsigned char *msg, int msglen, unsigned char *answer, int anslen'
+-for testproto in "${PROTO1}" \
++PROTO2='const u_char *msg, int msglen, u_char *answer, int anslen'
++for PROTO in "${PROTO1}" \
+ "${PROTO2}"
+ do
+ if test "${PROTO}" = ""; then
+@@ -397,8 +395,8 @@
+ dnl Find the correct res_search prototype on this machine
+ AC_MSG_CHECKING(for correct res_search prototype)
+ PROTO=
+-PROTO1='const char *dname, int class, int type,unsigned char *answer, int anslen'
+-for testproto in "${PROTO1}"
++PROTO1='const char *dname, int class, int type, u_char *answer, int anslen'
++for PROTO in "${PROTO1}"
+ do
+ if test "${PROTO}" = ""; then
+ AC_TRY_COMPILE([
+@@ -417,8 +415,8 @@
+ dnl Find the correct res_query prototype on this machine
+ AC_MSG_CHECKING(for correct res_query prototype)
+ PROTO=
+-PROTO1='const char *dname, int class, int type,unsigned char *answer, int anslen'
+-for testproto in "${PROTO1}"
++PROTO1='const char *dname, int class, int type, u_char *answer, int anslen'
++for PROTO in "${PROTO1}"
+ do
+ if test "${PROTO}" = ""; then
+ AC_TRY_COMPILE([
+@@ -462,7 +460,7 @@
+ dnl Find the correct poll prototype on this machine
+ AC_MSG_CHECKING(for correct poll prototype)
+ PROTO=
+-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' \
++for testproto in 'struct pollfd *ufds, u_long nfds, int timeout' \
+ 'struct pollfd *ufds, nfds_t nfds, int timeout'
+ do
+ if test "${PROTO}" = ""; then
diff --git a/net/torsocks/files/patch-torsocks.in b/net/torsocks/files/patch-torsocks.in
new file mode 100644
index 000000000000..6d7bc6ed8aaf
--- /dev/null
+++ b/net/torsocks/files/patch-torsocks.in
@@ -0,0 +1,37 @@
+--- src/torsocks.in.orig 2008-12-08 23:43:55.000000000 +0200
++++ src/torsocks.in 2009-03-01 22:31:16.263795616 +0200
+@@ -72,16 +72,16 @@
+ on)
+ if [ -z "$LD_PRELOAD" ]
+ then
+- export LD_PRELOAD="@prefix@/lib/torsocks/libtorsocks.so"
++ export LD_PRELOAD="@prefix@/lib/libtorsocks.so"
+ else
+- echo $LD_PRELOAD | grep -q "@prefix@/lib/torsocks/libtorsocks\.so" || \
+- export LD_PRELOAD="@prefix@/lib/torsocks/libtorsocks.so $LD_PRELOAD"
++ echo $LD_PRELOAD | grep -q "@prefix@/lib/libtorsocks\.so" || \
++ export LD_PRELOAD="@prefix@/lib/libtorsocks.so $LD_PRELOAD"
+ fi
+ ;;
+ off)
+ #replace '/' with '\/' in @prefix@
+ escprefix=`echo '@prefix@' |sed 's/\\//\\\\\//g'`
+- export LD_PRELOAD=`echo -n $LD_PRELOAD | sed "s/$escprefix\/lib\/torsocks\/libtorsocks.so \?//"`
++ export LD_PRELOAD=`echo -n $LD_PRELOAD | sed "s/$escprefix\/lib\/libtorsocks.so \?//"`
+ if [ -z "$LD_PRELOAD" ]
+ then
+ unset LD_PRELOAD
+@@ -96,10 +96,10 @@
+ *)
+ if [ -z "$LD_PRELOAD" ]
+ then
+- export LD_PRELOAD="@prefix@/lib/torsocks/libtorsocks.so"
++ export LD_PRELOAD="@prefix@/lib/libtorsocks.so"
+ else
+- echo $LD_PRELOAD | grep -q "@prefix@/lib/torsocks/libtorsocks\.so" || \
+- export LD_PRELOAD="@prefix@/lib/torsocks/libtorsocks.so $LD_PRELOAD"
++ echo $LD_PRELOAD | grep -q "@prefix@/lib/libtorsocks\.so" || \
++ export LD_PRELOAD="@prefix@/lib/libtorsocks.so $LD_PRELOAD"
+ fi
+
+ if [ $# = 0 ]
diff --git a/net/torsocks/files/patch-tsocks.c b/net/torsocks/files/patch-tsocks.c
new file mode 100644
index 000000000000..5cdbab984160
--- /dev/null
+++ b/net/torsocks/files/patch-tsocks.c
@@ -0,0 +1,11 @@
+--- src/tsocks.c.orig 2009-02-12 15:59:50.000000000 +0200
++++ src/tsocks.c 2009-02-12 23:18:14.870533468 +0200
+@@ -164,7 +164,7 @@
+ void tsocks_init(void) {
+
+ #define LOAD_ERROR(s,l) { \
+- char *error; \
++ const char *error; \
+ error = dlerror(); \
+ show_msg(l, "The symbol %s() was not found in any shared " \
+ "library. The error reported was: %s!\n", s, \
diff --git a/net/torsocks/files/patch-usewithtor.in b/net/torsocks/files/patch-usewithtor.in
new file mode 100644
index 000000000000..71da1270906f
--- /dev/null
+++ b/net/torsocks/files/patch-usewithtor.in
@@ -0,0 +1,16 @@
+--- src/usewithtor.in.orig 2009-02-12 15:59:50.000000000 +0200
++++ src/usewithtor.in 2009-02-12 19:49:41.000000000 +0200
+@@ -1,3 +1,5 @@
++#!/bin/sh
++#
+ # ***************************************************************************
+ # * *
+ # * $Id: usewithtor.in,v 1.3 2008-07-06 15:17:35 hoganrobert Exp $*
+@@ -26,7 +28,6 @@
+ # ***************************************************************************
+
+
+-#! /bin/sh
+
+ # Wrapper script for use of the torsocks(8) transparent socksification library
+ # See the torsocks(1) and usewithtor(1) manpages.
diff --git a/net/torsocks/files/pkg-message.in b/net/torsocks/files/pkg-message.in
new file mode 100644
index 000000000000..81434dee0c78
--- /dev/null
+++ b/net/torsocks/files/pkg-message.in
@@ -0,0 +1,12 @@
+Simple setup file was copied to %%PREFIX%%/etc/torsocks.conf.sample
+An example of a more complex setup file can be found in
+%%PREFIX%%/share/examples/torsocks/
+
+Once you have installed torsocks, just launch it like so:
+ usewithtor [application]
+
+So, for example you can use ssh to a some.ssh.com by doing:
+ usewithtor ssh username@some.ssh.com -l <user>
+
+or launch pidgin by doing:
+ usewithtor pidgin
diff --git a/net/torsocks/pkg-descr b/net/torsocks/pkg-descr
new file mode 100644
index 000000000000..e51cd9f67bbe
--- /dev/null
+++ b/net/torsocks/pkg-descr
@@ -0,0 +1,8 @@
+It is new generation of TSOCKS.
+
+Torsocks allows you to use most socks-friendly applications in
+a safe way with Tor. It ensures that DNS requests are handled
+safely and explicitly rejects UDP traffic from the application
+you're using.
+
+WWW: http://code.google.com/p/torsocks/
diff --git a/net/torsocks/pkg-plist b/net/torsocks/pkg-plist
new file mode 100644
index 000000000000..533d83fd24ef
--- /dev/null
+++ b/net/torsocks/pkg-plist
@@ -0,0 +1,12 @@
+bin/torsocks
+bin/usewithtor
+etc/torsocks.conf.sample
+lib/libtorsocks.a
+lib/libtorsocks.la
+lib/libtorsocks.so
+lib/libtorsocks.so.1
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.complex.example
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.simple.example
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%