diff options
author | Lauri Aarnio <Lauri.Aarnio@iki.fi> | 2009-02-12 16:28:19 +0200 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2009-02-16 11:50:38 +0200 |
commit | bcba4d20d1f3fbd1e78b386384b04f32724111c8 (patch) | |
tree | 1e78bed166aafeaea2bd7edc897e9d1fbf9e0810 /lua_scripts | |
parent | 09ef40c70908974f85e5d24eaf5c4296000d2474 (diff) |
"tools" mode bugfix: Don't map the directory where sb2 was started
- this rule already exists in the "emulate" mode
Diffstat (limited to 'lua_scripts')
-rw-r--r-- | lua_scripts/pathmaps/tools/00_default.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lua_scripts/pathmaps/tools/00_default.lua b/lua_scripts/pathmaps/tools/00_default.lua index 24f6054..faec0d7 100644 --- a/lua_scripts/pathmaps/tools/00_default.lua +++ b/lua_scripts/pathmaps/tools/00_default.lua @@ -14,6 +14,15 @@ if (not tools) then tools = "/" end +-- 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 + -- If the permission token exists and contains "root", tools_root directories -- will be available in R/W mode. Otherwise it will be "mounted" R/O. local tools_root_is_readonly @@ -85,7 +94,10 @@ mapall_chain = { {path = "/var/lib/dpkg/status", replace_by = var_lib_dpkg_status_location, readonly = tools_root_is_readonly}, - -- The default is to map everything to tools_root + -- The default is to map everything to tools_root, + -- except 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 = tools_root, |