From f8c45339f72525c6826d6db6a5e2acc4d7475952 Mon Sep 17 00:00:00 2001 From: guilhem Date: Sat, 28 Sep 2013 16:08:15 -0400 Subject: Don't preprocess torify Since torify has been removed from tsocks, it doesn't need to be preprocessed. Closes #5505. --- contrib/torify | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ contrib/torify.in | 61 ------------------------------------------------------- 2 files changed, 61 insertions(+), 61 deletions(-) create mode 100755 contrib/torify delete mode 100755 contrib/torify.in (limited to 'contrib') diff --git a/contrib/torify b/contrib/torify new file mode 100755 index 000000000..54acfed65 --- /dev/null +++ b/contrib/torify @@ -0,0 +1,61 @@ +#! /bin/sh + +# This script used to call (the now deprecated) tsocks as a fallback in case +# torsocks wasn't installed. +# Now, it's just a backwards compatible shim around torsocks with reasonable +# behavior if -v/--verbose or -h/--help arguments are passed. +# +# Copyright (c) 2004, 2006, 2009 Peter Palfrader +# Modified by Jacob Appelbaum April 16th 2006 +# Stripped of all the tsocks cruft by ugh on February 22nd 2012 +# May be distributed under the same terms as Tor itself + + +compat() { + echo "torify is now just a wrapper around torsocks(1) for backwards compatibility." +} + +usage() { + compat + echo "Usage: $0 [-hv] [...]" +} + +case $# in 0) + usage >&2 + exit 1 +esac + +case $# in 1) + case $1 in -h|--help) + usage + exit 0 + esac +esac + +case $1 in -v|--verbose) + compat >&2 + shift +esac + +# taken from Debian's Developer's Reference, 6.4 +pathfind() { + OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$*" ]; then + IFS="$OLDIFS" + return 0 + fi + done + IFS="$OLDIFS" + return 1 +} + +if pathfind torsocks; then + exec torsocks "$@" + echo "$0: Failed to exec torsocks $@" >&2 + exit 1 +else + echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2 +fi + diff --git a/contrib/torify.in b/contrib/torify.in deleted file mode 100755 index 54acfed65..000000000 --- a/contrib/torify.in +++ /dev/null @@ -1,61 +0,0 @@ -#! /bin/sh - -# This script used to call (the now deprecated) tsocks as a fallback in case -# torsocks wasn't installed. -# Now, it's just a backwards compatible shim around torsocks with reasonable -# behavior if -v/--verbose or -h/--help arguments are passed. -# -# Copyright (c) 2004, 2006, 2009 Peter Palfrader -# Modified by Jacob Appelbaum April 16th 2006 -# Stripped of all the tsocks cruft by ugh on February 22nd 2012 -# May be distributed under the same terms as Tor itself - - -compat() { - echo "torify is now just a wrapper around torsocks(1) for backwards compatibility." -} - -usage() { - compat - echo "Usage: $0 [-hv] [...]" -} - -case $# in 0) - usage >&2 - exit 1 -esac - -case $# in 1) - case $1 in -h|--help) - usage - exit 0 - esac -esac - -case $1 in -v|--verbose) - compat >&2 - shift -esac - -# taken from Debian's Developer's Reference, 6.4 -pathfind() { - OLDIFS="$IFS" - IFS=: - for p in $PATH; do - if [ -x "$p/$*" ]; then - IFS="$OLDIFS" - return 0 - fi - done - IFS="$OLDIFS" - return 1 -} - -if pathfind torsocks; then - exec torsocks "$@" - echo "$0: Failed to exec torsocks $@" >&2 - exit 1 -else - echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2 -fi - -- cgit v1.2.3