wingo opened issue #11667:
async fn test_flags_and_type(dir: &Descriptor) { let open = |path: &str, oflags: OpenFlags, fdflags: DescriptorFlags| -> _ { dir.open_at(PathFlags::empty(), path.to_string(), oflags, fdflags) }; let d = open(".", OpenFlags::empty(), DescriptorFlags::MUTATE_DIRECTORY).await.unwrap(); assert_eq!(d.get_flags().await, Ok(DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY)); }I would expect that the directory is opened with
MUTATE_DIRECTORY. However it seems it is not:openat2(3, ".", {flags=O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_BENEATH}, 24) = 12 statx(12, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0 fcntl(12, F_GETFL) = 0x28000 (flags O_RDONLY|O_LARGEFILE|O_NOFOLLOW)It seems we only have
READ:thread '<unnamed>' (1) panicked at src/bin/filesystem.rs:620:5: assertion `left == right` failed left: Ok(DescriptorFlags(READ)) right: Ok(DescriptorFlags(READ | MUTATE_DIRECTORY))
wingo added the bug label to Issue #11667.
wingo commented on issue #11667:
It's weirder than that;
MUTATE_DIRECTORYdoesn't seem to be propagated at all:let d = open(".", OpenFlags::DIRECTORY, DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY).await.unwrap(); assert_eq!(d.get_flags().await, Ok(DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY));Here the assertion fails; the flags that I get are just
READ.
alexcrichton added the wasi:impl label to Issue #11667.
alexcrichton added the wasi label to Issue #11667.
alexcrichton commented on issue #11667:
I think
MUTATE_DIRECTORYis entirely unimplemented in Wasmtime. I'm not seeing any references to it at all. Wasmtime does implementREADandWRITEand I suspect in the transition to p2 this was changed in the WITs but never updated in Wasmtime, so variuos bits and pieces which check forWRITEprobably need to check for this instead.
wingo commented on issue #11667:
Preopened directories do have
MUTATE_DIRECTORYin wasmtime, fwiw.
Last updated: Dec 06 2025 at 06:05 UTC