-
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
wasip1: fix file open modes used by wasi-libc #1421
Conversation
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.
Looks like how you described in slack. I'm glad this is 100pct contained to wasip1!
Seems like I introduced a regression on wasi-testsuite, looking into it. |
So it seems we were accidentally passing one of the wasi-testsuite tests https://github.com/WebAssembly/wasi-testsuite/blob/main/tests/rust/src/bin/directory_seek.rs#L40-L44 The test validates that a directory cannot get the FD_SEEK right, since we were zeroing all bits it tricked the test into believing that we were denying seek permission on directories. |
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
fb474fc
to
742c2af
Compare
Signed-off-by: Achille Roussel <[email protected]>
I tuned the approach a bit to address the wasi-testsuite issue: instead of setting all bits of |
Signed-off-by: Achille Roussel <[email protected]>
Looks like there is going to be another creative behavior to track down on windows:
|
Signed-off-by: Achille Roussel <[email protected]>
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.
Probably worth splatting the comment recommendation, but either way thanks a lot for getting to the bottom of this and finding a pragmatic way out!
Co-authored-by: Crypt Keeper <[email protected]>
Signed-off-by: Achille Roussel <[email protected]>
This PR extends wazero's interpretation of rights in
wasi_snapshot_preview1.path_open
to allow programs to open files in either read-only, write-only, or read-write mode.