summaryrefslogtreecommitdiff
path: root/lua_scripts
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-09-24 11:48:31 +0300
committerLauri Leukkunen <lle@rahina.org>2008-09-27 00:02:43 +0300
commitda47e2494757818181e6d3005ff410776f21046e (patch)
tree5114b1547d8b4461e6d6218bf2d0549f3ff9132b /lua_scripts
parent804dadf79f6373dd59b36ff23be4f77272d52742 (diff)
"emulate" mode: Don't map the working directory where sb2 was started ...unless that happens to be the root directory.
Diffstat (limited to 'lua_scripts')
-rw-r--r--lua_scripts/pathmaps/emulate/00_default.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua_scripts/pathmaps/emulate/00_default.lua b/lua_scripts/pathmaps/emulate/00_default.lua
index 85211e3..2a43588 100644
--- a/lua_scripts/pathmaps/emulate/00_default.lua
+++ b/lua_scripts/pathmaps/emulate/00_default.lua
@@ -3,6 +3,15 @@
sb1_compat_dir = sbox_target_root .. "/scratchbox1-compat"
+-- Don't map the working directory where sb2 was started, unless
+-- that happens to be the root directory.
+if sbox_workdir == "/" then
+ -- FIXME. There should be a way to skip a rule...
+ unmapped_workdir = "/XXXXXX"
+else
+ unmapped_workdir = sbox_workdir
+end
+
mapall_chain = {
next_chain = nil,
binary = nil,
@@ -32,6 +41,10 @@ mapall_chain = {
{prefix = "/etc/resolv.conf", use_orig_path = true},
+ -- The default is to map everything to target_root,
+ -- execpt that we don't map the directory tree where
+ -- sb2 was started.
+ {prefix = unmapped_workdir, use_orig_path = true},
{path = "/", use_orig_path = true},
{prefix = "/", map_to = target_root}
}