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

Use ENOENT rather than ENOTCAPABLE for missing preopens. #370

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

sunfishcode
Copy link
Member

When a user calls open with a path that does not have a corresponding preopen, set errno to ENOENT rather than ENOTCAPABLE. This conceptually represents an attempt to open a path which has not been provided within the sandbox, so it's more accurately represented as "not present" rather than "insufficient capabilities".

Also, this is one step in migrating away from having ENOTCAPABLE as an error code. It came from CloudABI, but it isn't in POSIX and portable application code isn't expecting it.

When a user calls `open` with a path that does not have a corresponding
preopen, set errno to `ENOENT` rather than `ENOTCAPABLE`. This
conceptually represents an attempt to open a path which has not been
provided within the sandbox, so it's more accurately represented as
"not present" rather than "insufficient capabilities".
@sunfishcode sunfishcode merged commit b8aa399 into main Dec 21, 2022
@sunfishcode sunfishcode deleted the sunfishcode/notcapable branch December 21, 2022 23:47
sunfishcode added a commit to WebAssembly/wasi-sdk that referenced this pull request Jan 9, 2023
Update to wasi-libc a1c7c2c7a4b2813c6f67bd2ef6e0f430d31cebad
 - Don't use sbrk(0) to determine the initial heap size (WebAssembly/wasi-libc#377)
 - Fix more headers to avoid depending on `max_align_t` (WebAssembly/wasi-libc#375)
 - Use `ENOENT` rather than `ENOTCAPABLE` for missing preopens. (WebAssembly/wasi-libc#370)
 - Adjust Makefile for LLVM trunk (16) as of 2022-11-08 (WebAssembly/wasi-libc#344)
jedisct1 added a commit to jedisct1/zig that referenced this pull request Jan 9, 2023
Some notable changes:
- `ENOENT` is returned instead of `ENOTCAPABLE` when a path has not
be pre-opened (WebAssembly/wasi-libc#370)
- `fd_readdir()`: some implementations may not set the inode number,
so an additional call to `fstatat()` is now done in order to get it
when that happens.
sunfishcode added a commit to WebAssembly/wasi-sdk that referenced this pull request Jan 9, 2023
Update to wasi-libc a1c7c2c7a4b2813c6f67bd2ef6e0f430d31cebad
 - Don't use sbrk(0) to determine the initial heap size (WebAssembly/wasi-libc#377)
 - Fix more headers to avoid depending on `max_align_t` (WebAssembly/wasi-libc#375)
 - Use `ENOENT` rather than `ENOTCAPABLE` for missing preopens. (WebAssembly/wasi-libc#370)
 - Adjust Makefile for LLVM trunk (16) as of 2022-11-08 (WebAssembly/wasi-libc#344)
andrewrk pushed a commit to ziglang/zig that referenced this pull request Jan 10, 2023
Some notable changes:
- `ENOENT` is returned instead of `ENOTCAPABLE` when a path has not
be pre-opened (WebAssembly/wasi-libc#370)
- `fd_readdir()`: some implementations may not set the inode number,
so an additional call to `fstatat()` is now done in order to get it
when that happens.
toyobayashi added a commit to toyobayashi/wasm-util that referenced this pull request Feb 18, 2023
john-sharratt pushed a commit to john-sharratt/wasix-libc that referenced this pull request Mar 6, 2023
…mbly#370)

When a user calls `open` with a path that does not have a corresponding
preopen, set errno to `ENOENT` rather than `ENOTCAPABLE`. This
conceptually represents an attempt to open a path which has not been
provided within the sandbox, so it's more accurately represented as
"not present" rather than "insufficient capabilities".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants