-
Notifications
You must be signed in to change notification settings - Fork 267
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
wasi: path_open
should accept a dir with RIGHT_FD_WRITE
#2244
Conversation
This commit fixes a `path_open` behavior that allows a directory to be `path_open`ed with the `rights::fd_write` flag. Since Wazero considers it to be an error to open a directory with the write flag normally, it is safe to treat this as a bug. Although rights/capability system is being scrapped, we still use the `fd_read` and `fd_write` flag to determine if write permission needs to be set. fixes tetratelabs#2243 Signed-off-by: Yage Hu <me@huyage.dev>
Interesting apparently this fails a test case in the zig stdlib! |
I checked out main and the Zig stdlib test is still failing. Seems unrelated? |
First, thanks anyway for the contribution! Now, unfortunately I checked out both this branch and
make sure you first build the zig test cases, see wazero/.github/workflows/integration.yaml Line 77 in 253c034
Regardless, the PR should include a test for this case too. |
Ahh OK it uses the built Wazero. I just had to rebuild wazero. Now I can repro. Thanks! |
Signed-off-by: Yage Hu <me@huyage.dev>
Signed-off-by: Yage Hu <me@huyage.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a minor change, overall looks fine!
path_open
should accept a dir with RIGHT_FD_WRITE
This commit fixes a
path_open
behavior that allows a directory to bepath_open
ed with therights::fd_write
flag. Since Wazero considers it to be an error to open a directory with the write flag normally, it is safe to treat this as a bug. Although rights/capability system is being scrapped, we still use thefd_read
andfd_write
flag to determine if write permission needs to be set.fixes #2243