Stream: git-wasmtime

Topic: wasmtime / PR #6283 Backport "Allow WASI to open director...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 16:32):

jameysharp opened PR #6283 from jameysharp:backport-6163 to bytecodealliance:release-8.0.0:

The O_DIRECTORY flag is a request that open should fail if the named path is not a directory. Opening a path which turns out to be a directory is not supposed to fail if this flag is not specified. However, wasi-common required callers to use it when opening directories.

With this PR, we always open the path the same way whether or not the O_DIRECTORY flag is specified. However, after opening it, we stat it to check whether it turned out to be a directory, and determine which operations the file descriptor should support accordingly. In addition, we explicitly check whether the precondition defined by O_DIRECTORY is satisfied.

On Windows, when opening a path which might be a directory using CreateFile, cap-primitives also removes the FILE_SHARE_DELETE mode. That means that if we implement WASI's path_open such that it always uses CreateFile on Windows, for both files and directories, then holding an open file handle prevents deletion of that file.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 16:32):

jameysharp requested alexcrichton for a review on PR #6283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 16:32):

jameysharp requested wasmtime-core-reviewers for a review on PR #6283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 17:29):

alexcrichton submitted PR review:

Thanks! Mind adding an entry to RELEASES.md as well?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 17:43):

jameysharp requested wasmtime-default-reviewers for a review on PR #6283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 17:43):

jameysharp updated PR #6283.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 17:51):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2023 at 21:27):

jameysharp merged PR #6283.


Last updated: Dec 23 2024 at 13:07 UTC