bytecodealliance / bytecodealliance/wasmtime

wasi:fs mutate-directory ignored

Open
#12,912 3 comments 0 reactions 0 assignees View on GitHub
wasi:impl
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

### Overview
As far as I can tell, wasmtime never checks [`descriptor-flags.mutate-directory`](https://github.com/WebAssembly/WASI/blob/50b674e4349aca006cccd699c1a5b6925cae6e88/proposals/filesystem/wit/types.wit#L102).

Also, wasmtime seems to be passing down `mutate-directory` in `open-at` even when the caller/guest doesn't ask for it.

See line 1054 where the parent's permissions are just passed down:
https://github.com/bytecodealliance/wasmtime/blob/33e8b3d955697587b23cf39d87fbcbdb4d26b0c9/crates/wasi/src/filesystem.rs#L1052-L1058

### Expected Results

`mutate-directory` should be required when editing directories, and should not be passed down from the parent automatically.

### Actual Results

`mutate-directory` is ignored, and is passed down from the parent automatically.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.