fix(native): scripts on session mounts outside the rootfs run with the rootfs shell

This commit is contained in:
Kurt Himebauch committed 2026-11-09 09:06:11 -05:00
1 parent ea51a373d7
commit cb7cfd516e
2 files changed
+14 -2

No files matched your search

+2 -2
View File
@@ -245,7 +245,7 @@ static int ddnatv_execve(const char *filename, char *const argv[], char *const e
char resolved_target[PATH_MAX];
// Only intercept binaries/scripts within DDNATV_ROOT
if (g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) {
if ((g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(filename)) {
struct exec_probe probe;
const char *elf_target = select_exec_target(target, resolved_target, sizeof(resolved_target), &probe);
if (probe.is_elf && !probe.is_dynamic) static_elf = elf_target;
@@ -798,7 +798,7 @@ static int ddnatv_posix_spawn(pid_t *pid, const char *path,
}
char *const *orig_ep = envp ? envp : environ;
int in_root = g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0;
int in_root = (g_ddnatv_root[0] != '\0' && strncmp(target, g_ddnatv_root, g_ddnatv_root_len) == 0) || is_mapped_guest_path(path);
struct exec_probe probe;
char resolved_target[PATH_MAX];