diff options
author | Lauri Leukkunen <lle@rahina.org> | 2007-01-11 01:04:43 +0200 |
---|---|---|
committer | Lauri Leukkunen <lleukkun@leka.rahina.org> | 2007-01-11 01:04:43 +0200 |
commit | 657b20c1bb0cffdfea36c8d83cf3f9ca57fd9d60 (patch) | |
tree | f0eb93e387530eb44bf2c02d34cffaa919ec33a6 /redir_scripts | |
parent | 5d5d5b9783cab6a232c2564f5594fe7d41b802c0 (diff) |
* add --verbose switch to sb2 to enable debugging of the mapping
rules
Diffstat (limited to 'redir_scripts')
-rw-r--r-- | redir_scripts/main.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/redir_scripts/main.lua b/redir_scripts/main.lua index 1f55d39..63e2101 100644 --- a/redir_scripts/main.lua +++ b/redir_scripts/main.lua @@ -18,6 +18,8 @@ if (not compiler_root) then compiler_root = "/usr" end +verbose = os.getenv("SBOX_MAPPING_VERBOSE") + -- SBOX_REDIR_SCRIPTS environment variable controls where -- we look for the scriptlets defining the path mappings @@ -159,14 +161,16 @@ function sbox_translate_path(binary_name, func_name, work_dir, path) rule = find_rule(chains[n], func_name, rp) if (not rule) then -- error, not even a default rule found - --print(string.format("Unable to find a match at all: [%s][%s][%s]", binary_name, func_name, path)) + print(string.format("Unable to find a match at all: [%s][%s][%s]", binary_name, func_name, path)) return path end if (rule.custom_map_func ~= nil) then return rule.custom_map_func(binary_name, func_name, work_dir, rp, path, rules[n]) else ret = sbox_map_to(binary_name, func_name, work_dir, rp, path, rule) - --print(string.format("[%i]%s: %s(%s) -> [%s]", n, binary_name, func_name, path, ret)) + if (verbose) then + print(string.format("[%i]%s: %s(%s) -> [%s]", n, binary_name, func_name, path, ret)) + end return ret end end |