From d7f6c1068e809e2ffc5102638654e42c8fffc127 Mon Sep 17 00:00:00 2001 From: Yage Hu Date: Mon, 18 Dec 2023 09:35:56 -0800 Subject: [PATCH] Fix preopened directory mapping to virtual root This commit fixes the bug where preopening `.` causes the WASI runner to map it to the virtual root, causing `path_open` to fail. fixes https://github.com/wasmerio/wasmer/issues/4361 --- lib/wasix/src/runners/wasi_common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wasix/src/runners/wasi_common.rs b/lib/wasix/src/runners/wasi_common.rs index d02fa7d2185..8c10868f746 100644 --- a/lib/wasix/src/runners/wasi_common.rs +++ b/lib/wasix/src/runners/wasi_common.rs @@ -49,7 +49,7 @@ impl CommonWasiOptions { if self.mapped_dirs.iter().all(|m| m.guest != ".") { // The user hasn't mounted "." to anything, so let's map it to "/" - builder.add_map_dir(".", "/")?; + builder.add_map_dir(".", "/mnt/host")?; } builder.set_fs(Box::new(fs));