diff options
-rw-r--r-- | preload/libsb2.c | 3 | ||||
-rw-r--r-- | preload/sb_alien.c | 14 | ||||
-rw-r--r-- | redir_scripts/main.lua | 5 | ||||
-rw-r--r-- | redir_scripts/parts/default.lua | 10 |
4 files changed, 9 insertions, 23 deletions
diff --git a/preload/libsb2.c b/preload/libsb2.c index 9dff6cb..631ce9b 100644 --- a/preload/libsb2.c +++ b/preload/libsb2.c @@ -902,7 +902,7 @@ static int do_exec(const char *file, char *const *argv, char *const *envp) } else { my_file = strdup(sb_gcc_wrapper); } - DBGOUT("we've a gcc tool!\n"); + /* DBGOUT("we've a gcc tool!\n"); */ my_argv[i++] = strdup(binaryname); } @@ -2136,6 +2136,7 @@ int nftw64 (const char *dir, int (*fn)(const char *file, const struct stat64 *sb int open (const char *pathname, int flags, ...) { int mode = 0; char *fakechroot_path; + expand_chroot_path(pathname, fakechroot_path); if (flags & O_CREAT) { diff --git a/preload/sb_alien.c b/preload/sb_alien.c index b5d32ef..259c29c 100644 --- a/preload/sb_alien.c +++ b/preload/sb_alien.c @@ -126,15 +126,11 @@ int run_app(char *file, char **argv, char *const *envp) binaryname = basename(strdup(file)); - DBGOUT("[%s][%s]\n", file, argv[0]); - /* printf("in run_app(%s)\n", file); */ + /* DBGOUT("[%s][%s]\n", file, argv[0]); */ argc = elem_count(argv); - /* printf("before pre_args()\n"); */ pre = pre_args(binaryname, &argv[1]); - /* printf("before post_args()\n"); */ post = post_args(binaryname); - /* printf("after post_args()\n"); */ /* DBGOUT("allocating: %i\n", elem_count(pre) + argc + elem_count(post) + 1); */ my_argv = (char **)calloc(elem_count(pre) + argc + elem_count(post) + 1, sizeof (char *)); @@ -143,23 +139,17 @@ int run_app(char *file, char **argv, char *const *envp) for (p=pre; *p; p++) my_argv[i++]=*p; - /* printf("after pre\n"); */ - for (p=argv+1; *p; p++) my_argv[i++]=*p; - /* printf("after argv\n"); */ - for (p=post; *p; p++) my_argv[i++]=*p; my_argv[i] = NULL; - /* printf("after post\n"); */ - /* DBGOUT("about to execute: %s\n", my_argv[0]); */ -#if 1 +#if 0 DBGOUT("**** CRAP starts here ****\n"); for (p=my_argv; *p; p++) { DBGOUT("[%s]\n", *p); 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)) diff --git a/redir_scripts/parts/default.lua b/redir_scripts/parts/default.lua index f379b68..2339ff6 100644 --- a/redir_scripts/parts/default.lua +++ b/redir_scripts/parts/default.lua @@ -99,15 +99,6 @@ default_scratchbox = { custom_map_func = nil } -default_root = { - binary = ".*", - func_name = ".*", - func_param = nil, - path = "/", - map_to = nil, - custom_map_func = nil -} - -- catch all rule to map everything else to TARGETDIR/ default_rootdir = { binary = ".*", @@ -127,7 +118,6 @@ export_rules = { default_proc, default_tmp, default_etc, - default_root, default_rootdir } |