Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "Allow WASI to open directories without O_DIRECTORY" (#6163) #6283

Merged
merged 2 commits into from
Apr 25, 2023

Commits on Apr 25, 2023

  1. Backport "Allow WASI to open directories without O_DIRECTORY" (byteco…

    …dealliance#6163)
    
    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.
    jameysharp committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    120a774 View commit details
    Browse the repository at this point in the history
  2. Update RELEASES.md

    jameysharp committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    aa50194 View commit details
    Browse the repository at this point in the history