aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-03-27 18:46:47 -0400
committerNick Mathewson <nickm@torproject.org>2012-03-27 18:46:47 -0400
commitfc35674567b005f1d096488fc92d81f662aaebe5 (patch)
tree20350f99c4c2a9a40e1fbb99464707d017b5a4e4 /contrib
parent5cd707dcd31201b0ec86769a22605a647bd8a6a8 (diff)
downloadtor-fc35674567b005f1d096488fc92d81f662aaebe5.tar
tor-fc35674567b005f1d096488fc92d81f662aaebe5.tar.gz
Changelog for torify changes
Also reinstate the part of the torify script that checks for torsocks being installed, so that we can give a more useful message in case it isn't.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/torify.in25
1 files changed, 22 insertions, 3 deletions
diff --git a/contrib/torify.in b/contrib/torify.in
index a5e1474e1..54acfed65 100755
--- a/contrib/torify.in
+++ b/contrib/torify.in
@@ -37,6 +37,25 @@ case $1 in -v|--verbose)
shift
esac
-exec torsocks "$@"
-echo "$0: Failed to exec torsocks $@" >&2
-exit 1
+# 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
+