fitzgen closed issue #617:
When discussing base and inheriting rights in
path_openin #570, we've discovered that, on Unix, our implementation ofpath_openwill implicitly open the derived descriptor with "read" access even when bothrights_baseandrights_inheritingare set to0. @marmistrz and I have since been wondering whether this is the intended behaviour or not (for reference, here's the link to the offending bit: [sys/unix/hostcalls_impl/fs.rs#L102]). Note further that, if you specify__WASI_RIGHT_FD_WRITE, we don't implicitly inherit the read right. All in all then, the possible states forrights_basecurrently are:
0implies "read" access__WASI_RIGHT_FD_READimplies "read" access__WASI_RIGHT_FD_WRITEimplies "write" access__WASI_RIGHT_FD_READ | __WASI_RIGHT_FD_WRITEimplies "read-write" accessThis could have a potential unexpected behaviour in implementations wrapping the WASI syscalls such as
std::fs::OpenOptionswhich assumes that__WASI_RIGHT_FD_READis acquired only if the client has indeed specified that they want the path opened for reading which with the current behaviour will not always be the case. Here's the link to the relevant implementation bit in Rust: [sys/wasi/fs.rs#L332].[sys/unix/hostcalls_impl/fs.rs#L102]: https://github.com/bytecodealliance/wasmtime/blob/master/crates/wasi-common/src/sys/unix/hostcalls_impl/fs.rs#L102
[sys/wasi/fs.rs#L332]: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/wasi/fs.rs#L332
fitzgen commented on issue #617:
WASI doesn't have rights anymore.
Last updated: Aug 30 2026 at 09:07 UTC