summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-10-08 17:42:31 +0300
committerLauri Leukkunen <lle@rahina.org>2008-10-18 15:18:14 +0300
commit5044503fe4a18abc3907b7634ac7f35d8bbb5c22 (patch)
tree2522011da75482b358a79f0ba16182ea8c247549 /utils
parent84fec609a79f33e73cd9d6e521cb77c615eea1a6 (diff)
Check if sb2 was called recursively from an existing sb2 session
Diffstat (limited to 'utils')
-rwxr-xr-xutils/sb28
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/sb2 b/utils/sb2
index f9057fb..24dfa13 100755
--- a/utils/sb2
+++ b/utils/sb2
@@ -536,6 +536,14 @@ do
done
shift $(($OPTIND - 1))
+if [ -n "$SBOX_SESSION_DIR" -a -f "$SBOX_SESSION_DIR/rules.lua" ]
+then
+ # already inside an sb2 session; ignore all options and just exec the command.
+ echo "WARNING: recursive calls to sb2 are not supported (session already exists)"
+ echo "WARNING: going to execute '$*' in this session"
+ exec $*
+fi
+
if [ "$SBOX_MAPPING_DEBUG" == "1" ]; then
# check that loglevel is valid
case $SBOX_MAPPING_LOGLEVEL in