ports/140531: [MAINTAINER] net/torsocks update to 1.0_2

Andrei Lavreniyuk andy.lavr at gmail.com
Fri Nov 13 15:40:01 UTC 2009


>Number:         140531
>Category:       ports
>Synopsis:       [MAINTAINER] net/torsocks update to 1.0_2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 13 15:40:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Andrei Lavreniyuk
>Release:        FreeBSD 8.0-PRERELEASE
>Organization:
Technica-03, Inc.
>Environment:
FreeBSD datacenter.technica-03.local 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #0: Thu Nov 12 11:35:21 EET 2009     root at datacenter.technica-03.local:/usr/obj/usr/src/sys/SMP64  amd64
>Description:

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN torsocks.bak/Makefile torsocks/Makefile
--- torsocks.bak/Makefile	2009-11-13 16:24:26.000000000 +0200
+++ torsocks/Makefile	2009-11-13 17:15:22.000000000 +0200
@@ -6,7 +6,7 @@
 
 PORTNAME=	torsocks
 PORTVERSION=	1.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net security
 MASTER_SITES=	GOOGLE_CODE \
 		http://tor.reactor-xg.kiev.ua/files/
diff -ruN torsocks.bak/files/patch-configure.in torsocks/files/patch-configure.in
--- torsocks.bak/files/patch-configure.in	2009-09-08 19:31:32.000000000 +0300
+++ torsocks/files/patch-configure.in	2009-11-13 16:49:34.000000000 +0200
@@ -1,5 +1,5 @@
---- configure.in.orig	2009-09-07 18:59:08.000000000 +0200
-+++ configure.in	2009-09-07 18:58:52.000000000 +0200
+--- configure.in.orig	2009-11-08 14:35:11.000000000 +0200
++++ configure.in	2009-11-13 16:49:06.984178608 +0200
 @@ -123,11 +123,9 @@
  dnl Checks for libraries.
  dnl Replace `main' with a function in -ldl:
@@ -15,7 +15,7 @@
  
  AC_CHECK_LIB(resolv, res_query, [ tempres="no" ],tempres="yes")
  if test "$tempres" = "no"; then
-@@ -356,11 +354,13 @@
+@@ -356,8 +354,8 @@
  dnl Find the correct res_querydomain prototype on this machine
  AC_MSG_CHECKING(for correct res_querydomain prototype)
  PROTO=
@@ -26,29 +26,20 @@
  do
    if test "${PROTO}" = ""; then
      AC_TRY_COMPILE([
-+      #include <sys/types.h>  
-+      #include <netinet/in.h>
-       #include <resolv.h>
-       int res_querydomain($testproto);
-     ],,[PROTO="$testproto";],)
-@@ -376,12 +376,14 @@
+@@ -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}"
++             "${PROTO2}"
  do
    if test "${PROTO}" = ""; then
      AC_TRY_COMPILE([
-+      #include <sys/types.h>
-+      #include <netinet/in.h>
-       #include <resolv.h>
-       int res_send($testproto);
-     ],,[PROTO="$testproto";],)
-@@ -397,11 +399,13 @@
+@@ -401,8 +399,8 @@
  dnl Find the correct res_search prototype on this machine
  AC_MSG_CHECKING(for correct res_search prototype)
  PROTO=
@@ -59,12 +50,7 @@
  do
    if test "${PROTO}" = ""; then
      AC_TRY_COMPILE([
-+      #include <sys/types.h>
-+      #include <netinet/in.h>
-       #include <resolv.h>
-       int res_search($testproto);
-     ],,[PROTO="$testproto";],)
-@@ -417,11 +421,13 @@
+@@ -423,8 +421,8 @@
  dnl Find the correct res_query prototype on this machine
  AC_MSG_CHECKING(for correct res_query prototype)
  PROTO=
@@ -75,28 +61,12 @@
  do
    if test "${PROTO}" = ""; then
      AC_TRY_COMPILE([
-+      #include <sys/types.h>
-+      #include <netinet/in.h>
-       #include <resolv.h>
-       int res_query($testproto);
-     ],,[PROTO="$testproto";],)
-@@ -447,6 +453,7 @@
- do
-   if test "${PROTO}" = ""; then
-     AC_TRY_COMPILE([
-+      #include <sys/types.h>
-       #include <sys/socket.h>
-       int getpeername($testproto);
-     ],,[PROTO="$testproto";],)
-@@ -462,8 +469,9 @@
+@@ -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' \
--                 'struct pollfd *ufds, nfds_t 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'
+                  'struct pollfd *ufds, nfds_t nfds, int timeout' \
+                  'struct pollfd *pfd, unsigned int nfds, int timeout'
  do
-   if test "${PROTO}" = ""; then
-     AC_TRY_COMPILE([
diff -ruN torsocks.bak/files/patch-src-dead_pool.c torsocks/files/patch-src-dead_pool.c
--- torsocks.bak/files/patch-src-dead_pool.c	2009-09-08 19:31:32.000000000 +0300
+++ torsocks/files/patch-src-dead_pool.c	1970-01-01 03:00:00.000000000 +0300
@@ -1,11 +0,0 @@
---- src/dead_pool.c	2009-02-07 12:00:03.000000000 +0100
-+++ src/dead_pool.c	2009-08-18 07:35:08.000000000 +0200
-@@ -725,7 +721,7 @@
-     /* TODO: work out what to do with AF_INET6 requests */
- 
- #ifdef HAVE_INET_ATON
--    if(inet_aton(node, &addr) == 0) {
-+    if(node && inet_aton(node, &addr) == 0 && memcmp(node,"*",1)) {
- #elif defined(HAVE_INET_ADDR)
-     /* If we're stuck with inet_addr, then getaddrinfo() won't work 
-        properly with 255.255.255.255 (= -1).  There's not much we can
diff -ruN torsocks.bak/files/patch-tsocks.c torsocks/files/patch-tsocks.c
--- torsocks.bak/files/patch-tsocks.c	2009-09-08 19:31:32.000000000 +0300
+++ torsocks/files/patch-tsocks.c	2009-11-13 17:05:58.000000000 +0200
@@ -1,5 +1,5 @@
---- src/tsocks.c	2009-02-07 11:48:12.000000000 +0100
-+++ src/tsocks.c	2009-08-18 07:35:08.000000000 +0200
+--- src/tsocks.c.orig	2009-11-08 14:35:11.000000000 +0200
++++ src/tsocks.c	2009-11-13 17:00:10.412574127 +0200
 @@ -54,6 +54,13 @@
  #define _GNU_SOURCE
  #endif
@@ -14,15 +14,15 @@
  /* Global configuration variables */
  const char *progname = "libtorsocks";         /* Name used in err msgs    */
  
-@@ -66,7 +73,6 @@
+@@ -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>
--#include <sys/types.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <sys/poll.h>
-@@ -164,7 +164,7 @@
+@@ -163,7 +169,7 @@
  void tsocks_init(void) {
  
  #define LOAD_ERROR(s,l) { \
@@ -31,86 +31,3 @@
      error = dlerror(); \
      show_msg(l, "The symbol %s() was not found in any shared " \
                       "library. The error reported was: %s!\n", s, \
-@@ -278,9 +284,9 @@
- #ifndef ALLOW_MSG_OUTPUT
-    set_log_options(-1, (char *)stderr, 0);
- #else
--   if ((env = getenv("TSOCKS_DEBUG")))
-+   if ((env = getenv("TORSOCKS_DEBUG")))
-       loglevel = atoi(env);
--   if (((env = getenv("TSOCKS_DEBUG_FILE"))) && !suid)
-+   if (((env = getenv("TORSOCKS_DEBUG_FILE"))) && !suid)
-       logfile = env;
-    set_log_options(loglevel, logfile, 1);
- #endif
-@@ -299,7 +305,7 @@
-     /* Determine the location of the config file */
-   #ifdef ALLOW_ENV_CONFIG
-     if (!suid) 
--        conffile = getenv("TSOCKS_CONF_FILE");
-+        conffile = getenv("TORSOCKS_CONF_FILE");
-   #endif
-     
-     /* Read in the config file */
-@@ -367,8 +373,8 @@
-     /* If this a UDP socket  */
-     /* then we refuse it, since it is probably a DNS request      */
-     if ((sock_type != SOCK_STREAM)) {
--        show_msg(MSGERR, "Connection is a UDP stream, may be a "
--                           "DNS request: rejecting.\n");
-+        show_msg(MSGERR, "connect: Connection is a UDP or ICMP stream, may be a "
-+                           "DNS request or other form of leak: rejecting.\n");
-         return -1;
-     }
- #endif
-@@ -1331,20 +1337,20 @@
-         nixuser = getpwuid(getuid());
- 
-         if (((uname = conn->path->defuser) == NULL) &&
--          ((uname = getenv("TSOCKS_USERNAME")) == NULL) &&
-+          ((uname = getenv("TORSOCKS_USERNAME")) == NULL) &&
-             ((uname = (nixuser == NULL ? NULL : nixuser->pw_name)) == NULL)) {
-             show_msg(MSGERR, "Could not get SOCKS username from "
-                     "local passwd file, torsocks.conf "
--                    "or $TSOCKS_USERNAME to authenticate "
-+                    "or $TORSOCKS_USERNAME to authenticate "
-                     "with");
-           conn->state = FAILED;
-             return(ECONNREFUSED);
-         }
- 
--        if (((upass = getenv("TSOCKS_PASSWORD")) == NULL) &&
-+        if (((upass = getenv("TORSOCKS_PASSWORD")) == NULL) &&
-           ((upass = conn->path->defpass) == NULL)) {
-             show_msg(MSGERR, "Need a password in torsocks.conf or "
--                    "$TSOCKS_PASSWORD to authenticate with");
-+                    "$TORSOCKS_PASSWORD to authenticate with");
-           conn->state = FAILED;
-             return(ECONNREFUSED);
-         }
-@@ -1695,11 +1701,12 @@
-     /* If this a UDP socket  */
-     /* then we refuse it, since it is probably a DNS request      */
-     if ((sock_type != SOCK_STREAM)) {
--        show_msg(MSGERR, "Connection is a UDP stream, may be a "
--                           "DNS request: rejecting.\n");
-+        show_msg(MSGERR, "sendto: Connection is a UDP or ICMP stream, may be a "
-+                           "DNS request or other form of leak: rejecting.\n");
-         return -1;
-     }
- #endif
-+
-     return (ssize_t) realsendto(s, buf, len, flags, to, tolen);
- 
- }
-@@ -1748,8 +1755,8 @@
-     /* If this a UDP socket  */
-     /* then we refuse it, since it is probably a DNS request      */
-     if ((sock_type != SOCK_STREAM)) {
--        show_msg(MSGERR, "Connection is a UDP stream, may be a "
--                           "DNS request: rejecting.\n");
-+        show_msg(MSGERR, "sendmsg: Connection is a UDP or ICMP stream, may be a "
-+                           "DNS request or other form of leak: rejecting.\n");
-         return -1;
-     }
- #endif
diff -ruN torsocks.bak/files/patch-usewithtor.in torsocks/files/patch-usewithtor.in
--- torsocks.bak/files/patch-usewithtor.in	2009-09-08 19:31:32.000000000 +0300
+++ torsocks/files/patch-usewithtor.in	2009-11-13 17:14:39.000000000 +0200
@@ -1,124 +1,28 @@
---- src/usewithtor.in	2008-10-26 22:51:20.000000000 +0100
-+++ src/usewithtor.in	2009-08-18 07:35:08.000000000 +0200
-@@ -1,3 +1,4 @@
-+#! /bin/sh
+--- src/usewithtor.in.orig	2009-11-08 14:35:11.000000000 +0200
++++ src/usewithtor.in	2009-11-13 17:10:26.726475549 +0200
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#!/bin/sh
  # ***************************************************************************
  # *                                                                         *
  # * $Id: usewithtor.in,v 1.3 2008-07-06 15:17:35 hoganrobert Exp $*
-@@ -25,50 +26,84 @@
+@@ -26,8 +26,8 @@
  # *   Original copyright notice from tsocks source file follows:            *
  # ***************************************************************************
  
--
--#! /bin/sh
--
--# Wrapper script for use of the torsocks(8) transparent socksification library
--# See the torsocks(1) and usewithtor(1) manpages.
-+# Wrapper script for use of the tsocks(8) transparent socksification library
-+# See the tsocks(1) and torify(1) manpages.
+-# Wrapper script for use of the tsocks(8) transparent socksification library
+-# See the tsocks(1) and torify(1) manpages.
++# Wrapper script for use of the torsocks(8) transparent socksification library
++# See the torsocks(1) and torify(1) manpages.
  
  # Copyright (c) 2004, 2006 Peter Palfrader
  # Modified by Jacob Appelbaum <jacob at appelbaum.net> April 16th 2006
--# Modified by Robert Hogan <robert at roberthogan.net> March 2007
-+# Modified by Marcus Griep <marcus at griep.us> June 16 2009
+@@ -35,7 +35,7 @@
  # May be distributed under the same terms as Tor itself
  
  
--# Define and ensure we have torsocks
-+# Define and ensure we have tsocks
+-# Define and ensure we have tsocks
++# Define and ensure we have torsocks
  # XXX: what if we don't have which?
--TSOCKS="`which torsocks`"
--if [ ! -x "$TSOCKS" ]
--then
--        echo "$0: Can't find torsocks in PATH. Perhaps you haven't installed it?" >&2
--        exit 1
--fi
-+TORSOCKS="`which torsocks`"
-+PROG=
-+VERBOSE=
-+
-+usage () {
-+	echo "Usage: $0 [-hv] <command> [<options>...]"
-+}
-+
-+set_id () {
-+	echo "ERROR: $1 is set${2}id. usewithtor will not work on a set${2}id executable." >&2
-+	exit 1
-+}
- 
- # Check for any argument list
--if [ "$#" = 0 ]
--then
--        echo "Usage: $0 <command> [<options>...]" >&2
--        exit 1
-+if [ "$#" = 0 ]; then
-+	usage >&2
-+	exit 1
- fi
--if [ "$#" = 1 ] && ( [ "$1" = "-h" ] || [ "$1" = "--help" ] )
--then
--        echo "Usage: $0 <command> [<options>...]"
--        exit 0
-+
-+while [ "$1" ]; do
-+	case "$1" in
-+		-h|--h*)
-+			usage
-+			exit 0
-+			;;
-+		-v|--v*)
-+			VERBOSE=YesPlease
-+			shift
-+			;;
-+		*)
-+			break;
-+	esac
-+done
-+
-+if [ -u `which "$1"` ]; then
-+	set_id $1 u
-+elif [ -g `which "$1"` ]; then
-+	set_id $1 g
- fi
- 
--# Define our torsocks config file
--TSOCKS_CONF_FILE="@CONFDIR@/torsocks.conf"
--export TSOCKS_CONF_FILE
--
--# Check that we've got a torsocks config file
--if [ -r "$TSOCKS_CONF_FILE" ]
--then
--	exec torsocks "$@"
--	echo "$0: Failed to exec torsocks $@" >&2
--	exit 1
-+if [ -x "$TORSOCKS" ]; then
-+	PROG=torsocks
- else
--	echo "$0: Missing torsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2
-+	echo "$0: Unable to find torsocks in PATH." >&2
-+	echo "    Perhaps you haven't installed it?" >&2
- 	exit 1
- fi
-+
-+if [ "$VERBOSE" ]; then
-+	echo "We're armed with the following torsocks: $TORSOCKS"
-+	echo "We're attempting to use $PROG for all tor action."
-+fi
-+
-+if [ "$PROG" = "torsocks" ]; then
-+	# Define our torsocks config file
-+	TSOCKS_CONF_FILE="@CONFDIR@/torsocks.conf"
-+	export TSOCKS_CONF_FILE
-+
-+	# Check that we've got a torsocks config file
-+	if [ -r "$TSOCKS_CONF_FILE" ]; 	then
-+		exec torsocks "$@"
-+	else
-+		echo "$0: Missing torsocks configuration file \"$TSOCKS_CONF_FILE\" - torsocks will use defaults sensible for Tor." >&2
-+		exec torsocks "$@"
-+	fi
-+fi
-+
-+# We should have hit an exec. If we get here, we didn't exec
-+echo "$0: failed to exec $PROG $@" >&2
-+exit 1
+ TORSOCKS="`which torsocks`"
+ PROG=


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list