summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMika Westerberg <ext-mika.1.westerberg@nokia.com>2009-01-26 16:15:05 +0200
committerLauri Leukkunen <lle@rahina.org>2009-02-10 08:38:10 +0200
commit4cce31b57d50b667b03c34d37b42eb99254368f8 (patch)
treed494fd43ebdcb2b6bfd2de6d40e88c997d89fd07 /utils
parent11c9ef3f390169ca53f0dd7c3e9b1d584d561987 (diff)
Argv&envp mangling rules are now generated only once per session.
- There is new lua script: create_argvmods_rules.lua which is used to create explicit rules based rules created by argvenvp_xxx.lua. - Separated mangling rules for misc binaries to be in file argvenvp_misc.lua - Rules are generated by sb2 script and placed under $SBOX_SESSION_DIR/argvmods/*. Signed-off-by: Lauri Aarnio <Lauri.Aarnio@iki.fi>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/sb230
1 files changed, 29 insertions, 1 deletions
diff --git a/utils/sb2 b/utils/sb2
index 13d54b6..d1b052b 100755
--- a/utils/sb2
+++ b/utils/sb2
@@ -110,6 +110,25 @@ function create_reverse_rules()
done
}
+#
+# Generates argvmods for cross-compilers and misc binaries.
+# Generated files are placed under $SBOX_SESSION_DIR/argvmods/.
+#
+function create_argvmods_rules()
+{
+ /bin/mkdir -p $SBOX_SESSION_DIR/argvmods
+ SBOX_ARGVMODS_SOURCE_FILE="argvenvp_misc.lua" sb2-monitor \
+ -L $SBOX_LIBSB2 -- $SBOX_DIR/bin/sb2-show \
+ execluafile \
+ $SBOX_SESSION_DIR/lua_scripts/create_argvmods_rules.lua \
+ >$SBOX_SESSION_DIR/argvmods/argvmods_misc.lua
+ SBOX_ARGVMODS_SOURCE_FILE="argvenvp_gcc.lua" sb2-monitor \
+ -L $SBOX_LIBSB2 -- $SBOX_DIR/bin/sb2-show \
+ execluafile \
+ $SBOX_SESSION_DIR/lua_scripts/create_argvmods_rules.lua \
+ >$SBOX_SESSION_DIR/argvmods/argvmods_gcc.lua
+}
+
# Create some additional rules for the default mapping mode:
function create_argvmods_usr_bin_rules()
{
@@ -1146,8 +1165,17 @@ then
create_argvmods_usr_bin_rules "$CREATE_ARGVMODS_USR_BIN_RULES"
fi
-# Create reverse mapping rules before starting the actual command (or shell)
if [ -z "$SBOX_JOIN_SESSION_FILE" ]; then
+ #
+ # Only generate argvmods rules when we are not joining
+ # to session.
+ #
+ create_argvmods_rules
+
+ #
+ # Create reverse mapping rules before starting the
+ # actual command (or shell).
+ #
if [ "$SBOX_CREATE_REVERSE_RULES" == "y" ]; then
create_reverse_rules
else