TerrorJack labeled issue #6227:
Test Case
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main(int argc, char *argv[]) { chdir(argv[1]); if(fopen("bar", "rb") == NULL) { perror(strerror(errno)); exit(errno); } }Steps to Reproduce
Use
wasi-sdkto compile & linkfoo.cabove tofoo.wasm, then:$ touch /tmp/bar $ ln -s /tmp/bar bar $ wasmtime run --mapdir /::/ -- foo.wasm $PWDActual Results
The example above would fail with
Operation not permitted. However, I've explicitly passed--mapdir /::/towasmtime, so the entire host filesystem should be visible within the wasm module, and symlink resolution from$PWD/barto/tmp/barshould work out of the box.Versions and Environment
Wasmtime version or commit:
wasmtime-cli 7.0.0Operating system:
Ubuntu 22.10Architecture:
x86_64
TerrorJack opened issue #6227:
Test Case
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main(int argc, char *argv[]) { chdir(argv[1]); if(fopen("bar", "rb") == NULL) { perror(strerror(errno)); exit(errno); } }Steps to Reproduce
Use
wasi-sdkto compile & linkfoo.cabove tofoo.wasm, then:$ touch /tmp/bar $ ln -s /tmp/bar bar $ wasmtime run --mapdir /::/ -- foo.wasm $PWDActual Results
The example above would fail with
Operation not permitted. However, I've explicitly passed--mapdir /::/towasmtime, so the entire host filesystem should be visible within the wasm module, and symlink resolution from$PWD/barto/tmp/barshould work out of the box.Versions and Environment
Wasmtime version or commit:
wasmtime-cli 7.0.0Operating system:
Ubuntu 22.10Architecture:
x86_64
pchickey commented on issue #6227:
This may be the prohibition on absolute symlinks. If you instead
ln -s ../../tmp/bar bar, does it work?
TerrorJack commented on issue #6227:
It works with
../../tmp/bar. But still this looks like a bug to me, why does wasmtime unconditionally prohibit absolute symlinks even if the resolved result belongs to a mapped host directory?
Last updated: Dec 06 2025 at 06:05 UTC