Open yagehu opened 1 month ago
well, personally I am not against converging with other implementations, I suppose this used to be underspecified
well, personally I am not against converging with other implementations, I suppose this used to be underspecified
I can take a stab at it.
Describe the bug Due to the
path.Clean()
call in theatPath()
implementation, some paths that are rejected by other runtimes are OK in Wazero. For example, given a preopen directory fd and the patha/../a
,path.Clean()
would normalize away the..
and producea
as the final path. In runtimes such as Wasmtime and WAMR, since the firsta/
does not exist, a call involving that path returnsnoent
(44).To Reproduce This snippet will fail with Wasmtime, WAMR, WasmEdge, Wasmer. But Wazero creates the link
a
pointing tolink
successfully.Environment (please complete the relevant information):
Additional context The only other runtime that has the same behavior is Node with uvwasi. That's because uvwasi uses libuv which doesn't have an
openat(2)
equivalent (yet!).The
wasi-filesystem
spec describes a path resolution implementation that conflicts with the usage ofpath.Clean
and similar path normalization strategies.