Skip to content

Revert "libc-wasi: Make rights of STDIN/STDOUT/STDERR fixed and overl… #4448

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yamt
Copy link
Collaborator

@yamt yamt commented Jul 3, 2025

…ook their access modes (#3694)"

This reverts commit 67fa155.

because it broke certain use cases while
it isn't clear what it fixed.

tested with:
https://github.com/yamt/garbage/tree/master/wasm/httpd
https://github.com/yamt/garbage/tree/master/wasm/tty

cf.
#4447
#3686 (comment)

@lum1n0us
Copy link
Collaborator

lum1n0us commented Jul 3, 2025

I mostly agree that STDXXX can have variant st_filetype because of those tricks,

But, are you suggesting that removing read/write bits based on the access mode is acceptable according to STDXX?

switch (access_mode) {
    case WASI_LIBC_ACCESS_MODE_READ_ONLY:
        *rights_base &= ~(__wasi_rights_t)__WASI_RIGHT_FD_WRITE;
        break;
    case WASI_LIBC_ACCESS_MODE_WRITE_ONLY:
        *rights_base &= ~(__wasi_rights_t)__WASI_RIGHT_FD_READ;
        break;
}

@yamt
Copy link
Collaborator Author

yamt commented Jul 3, 2025

But, are you suggesting that removing read/write bits based on the access mode is acceptable according to STDXX?

yes. i think it's the most straightforward behavior.
what's your concern?

@lum1n0us lum1n0us added the bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs. label Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Determine if this PR addresses a bug. It will be used by scripts to classify PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants