ports/153465: [MAINTAINER] net/torsocks: update to 1.1
Andrei Lavreniyuk
andy.lavr at gmail.com
Mon Dec 27 10:10:05 UTC 2010
>Number: 153465
>Category: ports
>Synopsis: [MAINTAINER] net/torsocks: update to 1.1
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 27 10:10:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Andrei Lavreniyuk
>Release: FreeBSD 8.2-PRERELEASE
>Organization:
Technica-03, Inc.
>Environment:
FreeBSD datacenter.technica-03.local 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Thu Dec 16 14:20:51 EET 2010 root at datacenter.technica-03.local:/usr/obj/usr/src/sys/SMP64 amd64
>Description:
Torsocks 1.1
2010-12-12 Robert Hogan <robert at roberthogan.net>
o Handle wildcard addresses in getaddrinfo calls. Reported by Mike Perry.
o Move the address inspection to the end of sendmsg() and sendto()
so that we can exit early if the socket is not SOCK_STREAM (i.e.
tcp).
o Exit if Tor DNS is disabled.
Exit with an error code if Tor DNS is disabled in the configuration
or if we cannot reserve the deadpool address space for .onion
addresses.
o Always print error messages.
o Allow error logging by default.
o Style cleanup:
No brackets for single-statement conditionals
Whitespace fixes in tsocks.c
Remove torsocks.kdevelop
Remove non-free RFC and replace with link.
o Remove USE_TOR_DNS compile guard
This is a leftover from the tsocks days. We always want this option
enabled.
o Only enable debug output for debug builds
Debug output was printing on release builds and getting suppressed
on debug builds - which is the wrong way round!
o Make a global variable less generic
Exporting a global variable called 'progname' is not a good
idea if you are a library. Exporting global variables at all
is probably a bad idea.
For now, make the name less generic - it was causing crashes
when torsocks was used with dig.
Part of the fix for:
http://code.google.com/p/torsocks/issues/detail?id=15
o Use socket rather than address to determine connection type
In sendmsg() and sendto() we were inspecting the sock_addr_t
structure to determine if the connection was Internet or not.
Since msg->msg_name is an optional value in sendmsg() and
sendto() this could result in crashes because we weren't ensuring
it was non-null.
Since it's optional we should have been inspecting the SO_DOMAIN
of the connection's socket anyway - it will always be there.
Part of the fix for:
http://code.google.com/p/torsocks/issues/detail?id=15
o Major refactor of symbol hooking
Patch by alex at ohmantics.net
Make torsocks fully compatible with Snow Leopard OSX.
Slim down the symbol hooking code considerably.
Alex's notes:
"http://developer.apple.com/mac/library/releasenotes/Darwin/SymbolVariantsRelNotes/index.
don't have the $UNIX2003 variants. For working 10.6 support, we'll need to
conditionalize the UNIX2003 variants off when compiling for 64-bit."
o Improve compile-time detection of the res* family of system calls
Some platforms need to explicitly include resolv.h so cater for
that.
Thanks to SwissTorExit for reporting and debugging assistance.
o Do our best to ensure tsocks_init is called only once.
o Build fix for BSD.
Support presence of res_query in libc rather than libresolve.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -ruN torsocks.bak/Makefile torsocks/Makefile
--- torsocks.bak/Makefile 2010-12-06 08:50:01.000000000 +0200
+++ torsocks/Makefile 2010-12-27 09:31:25.000000000 +0200
@@ -5,12 +5,11 @@
# $FreeBSD: ports/net/torsocks/Makefile,v 1.8 2010/12/04 07:33:02 ade Exp $
PORTNAME= torsocks
-PORTVERSION= 1.0
-PORTREVISION= 3
+PORTVERSION= 1.1
CATEGORIES= net security
MASTER_SITES= GOOGLE_CODE \
http://tor.reactor-xg.kiev.ua/files/
-DISTNAME= ${PORTNAME}-${PORTVERSION}-epsilon
+DISTNAME= ${PORTNAME}-${PORTVERSION}
MAINTAINER= andy.lavr at gmail.com
COMMENT= Most SOCKS-friendly applications way with Tor
@@ -27,18 +26,13 @@
SUB_FILES= pkg-message
-OPTIONS= TORDNS "Use tordns" on \
- SOCKSDNS "Use socks server for DNS lookups" off \
+OPTIONS= 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
@@ -60,15 +54,6 @@
.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."
diff -ruN torsocks.bak/distinfo torsocks/distinfo
--- torsocks.bak/distinfo 2009-12-18 18:19:49.000000000 +0200
+++ torsocks/distinfo 2010-12-27 10:40:15.000000000 +0200
@@ -1,3 +1,2 @@
-MD5 (torsocks-1.0-epsilon.tar.gz) = 5f00676da97f198f95614db6e2804f35
-SHA256 (torsocks-1.0-epsilon.tar.gz) = e5aad7362462e8f76b6de6d9e6321e2e16ad8895e1a300b6ca19d49730890814
-SIZE (torsocks-1.0-epsilon.tar.gz) = 669553
+SHA256 (torsocks-1.1.tar.gz) = 09dac54c2bb4e57cfdc449dc45b97be832910a4d81d5a2931543b469d97fdf01
+SIZE (torsocks-1.1.tar.gz) = 674386
diff -ruN torsocks.bak/files/patch-Makefile.am torsocks/files/patch-Makefile.am
--- torsocks.bak/files/patch-Makefile.am 2009-03-08 15:57:27.000000000 +0200
+++ torsocks/files/patch-Makefile.am 1970-01-01 03:00:00.000000000 +0300
@@ -1,21 +0,0 @@
---- 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 -ruN torsocks.bak/files/patch-configure.in torsocks/files/patch-configure.in
--- torsocks.bak/files/patch-configure.in 2009-12-18 18:19:49.000000000 +0200
+++ torsocks/files/patch-configure.in 2010-12-27 11:46:52.000000000 +0200
@@ -15,58 +15,3 @@
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([
-@@ -378,9 +376,9 @@
- 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}"
-+PROTO2='const u_char *msg, int msglen, u_char *answer, int anslen'
-+for PROTO in "${PROTO1}" \
-+ "${PROTO2}"
- do
- if test "${PROTO}" = ""; then
- AC_TRY_COMPILE([
-@@ -401,8 +399,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([
-@@ -423,8 +421,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([
-@@ -471,7 +469,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' \
- 'struct pollfd *pfd, unsigned int nfds, int timeout'
- do
diff -ruN torsocks.bak/files/patch-torsocks.in torsocks/files/patch-torsocks.in
--- torsocks.bak/files/patch-torsocks.in 2009-03-08 15:57:27.000000000 +0200
+++ torsocks/files/patch-torsocks.in 1970-01-01 03:00:00.000000000 +0300
@@ -1,37 +0,0 @@
---- 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 -ruN torsocks.bak/files/patch-tsocks.c torsocks/files/patch-tsocks.c
--- torsocks.bak/files/patch-tsocks.c 2009-12-18 18:19:49.000000000 +0200
+++ torsocks/files/patch-tsocks.c 2010-12-27 10:54:56.000000000 +0200
@@ -14,14 +14,6 @@
/* Global configuration variables */
const char *progname = "libtorsocks"; /* Name used in err msgs */
-@@ -62,7 +69,6 @@
- #include <stdlib.h>
- #include <unistd.h>
- #include <dlfcn.h>
--#include <sys/types.h>
- #include <sys/socket.h>
- #include <string.h>
- #include <strings.h>
@@ -163,7 +169,7 @@
void tsocks_init(void) {
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list