[tor-commits] [torsocks/master] Only spawn a shell when called with "--shell"
ioerror at torproject.org
ioerror at torproject.org
Sun Jan 27 21:37:48 UTC 2013
commit b5dadbd0c5f36792234bd974ed970d1db54a6e1e
Author: Jacob Appelbaum <jacob at appelbaum.net>
Date: Tue Nov 6 17:38:29 2012 -0800
Only spawn a shell when called with "--shell"
This effective reverts the patch by intrigeri for issue 47:
http://code.google.com/p/torsocks/issues/detail?id=47
If torsocks is called with zero arguments, we will not spawn a shell
we will error out and refuse to continue.
If you wish to spawn a shell, we suggest calling torsocks like so:
torsocks --shell
---
doc/torsocks.1.in | 2 --
src/torsocks.in | 6 ++++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/doc/torsocks.1.in b/doc/torsocks.1.in
index 4ceba4c..555e661 100644
--- a/doc/torsocks.1.in
+++ b/doc/torsocks.1.in
@@ -54,8 +54,6 @@ Example:
". torsocks off" -- remove the torsocks lib from LD_PRELOAD
.IP \fB[show|sh]
show the current value of the LD_PRELOAD variable
-.IP \fB<without\ any\ argument>
-create a new shell with LD_PRELOAD including torsocks(8).
.IP \fB[--shell]
create a new shell with LD_PRELOAD including torsocks(8).
.PP
diff --git a/src/torsocks.in b/src/torsocks.in
index f1052cc..1a9952a 100755
--- a/src/torsocks.in
+++ b/src/torsocks.in
@@ -4,6 +4,7 @@
# * *
# * Copyright (C) 2008 by Robert Hogan *
# * robert at roberthogan.net *
+# * Copyright (C) 2012 by Jacob Appelbaum <jacob at torproject.org> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
@@ -68,6 +69,11 @@ set_id () {
exit 1
}
+if [ $# = 0 ] ; then
+ echo "$0: insufficient arguments"
+ exit
+fi
+
LIBDIR="@prefix@/lib/torsocks"
LIB_NAME="libtorsocks"
SHLIB_EXT="@SHLIB_EXT@"
More information about the tor-commits
mailing list