summaryrefslogtreecommitdiff
path: root/redir_scripts/main.lua
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2006-12-22 04:48:10 +0200
committerLauri Leukkunen <lleukkun@leka.rahina.org>2006-12-22 04:48:10 +0200
commit6dd431fdb8e5fdc780bcafe06bf451074d5cde58 (patch)
tree11a71e24dda47966737a5f58f69662a5720e5198 /redir_scripts/main.lua
parent7b4a706e21f953e26cdc6ed10c862a4f3e8b4f79 (diff)
* cleanup
* fix relative path handling in main.lua
Diffstat (limited to 'redir_scripts/main.lua')
-rw-r--r--redir_scripts/main.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/redir_scripts/main.lua b/redir_scripts/main.lua
index 596cad3..9e68ed6 100644
--- a/redir_scripts/main.lua
+++ b/redir_scripts/main.lua
@@ -110,6 +110,11 @@ function sbox_translate_path(binary_name, func_name, work_dir, path)
rp = path
end
+ if (string.sub(rp, 1, 1) ~= "/") then
+ -- relative path, convert to absolute
+ rp = work_dir .. "/" .. rp
+ end
+
-- loop through the rules, first match is used
for n=1,table.maxn(rules) do
-- print(string.format("looping through rules: %s, %s, %s", rules[n].binary, rules[n].func_name, rules[n].path))