-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[WASI] getpath.py does not handle "Capabilities insufficient" (ENOTCAPABLE) #96005
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
Comments
tiran
added a commit
to tiran/cpython
that referenced
this issue
Aug 15, 2022
- On WASI `ENOTCAPABLE` is now mapped to `PermissionError`. - The `errno` modules exposes the new error number. - `getpath.py` now ignores `PermissionError` when it cannot open landmark files `pybuilddir.txt` and `pyenv.cfg`.
SGTM! |
tiran
added a commit
that referenced
this issue
Aug 16, 2022
- On WASI `ENOTCAPABLE` is now mapped to `PermissionError`. - The `errno` modules exposes the new error number. - `getpath.py` now ignores `PermissionError` when it cannot open landmark files `pybuilddir.txt` and `pyenv.cfg`.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Aug 16, 2022
- On WASI `ENOTCAPABLE` is now mapped to `PermissionError`. - The `errno` modules exposes the new error number. - `getpath.py` now ignores `PermissionError` when it cannot open landmark files `pybuilddir.txt` and `pyenv.cfg`. (cherry picked from commit 48174fa) Co-authored-by: Christian Heimes <[email protected]>
tiran
added a commit
to tiran/cpython
that referenced
this issue
Aug 16, 2022
tiran
added a commit
that referenced
this issue
Aug 17, 2022
tiran
added a commit
to tiran/cpython
that referenced
this issue
Aug 17, 2022
tiran
added a commit
that referenced
this issue
Sep 13, 2022
) (GH-96038) - On WASI `ENOTCAPABLE` is now mapped to `PermissionError`. - The `errno` modules exposes the new error number. - `getpath.py` now ignores `PermissionError` when it cannot open landmark files `pybuilddir.txt` and `pyenv.cfg`.
Can this issue be closed, or is there something still to do? |
@tiran all good to close this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
WASI has a capability-based security concept. A process must have a valid handle to open a resource. For example WASI runtimes let processes only open files that are inside a directory tree for which the process owns a file descriptor. wasmtime implements this with openat2(2) with flags
RESOLVE_NO_MAGICLINKS | RESOLVE_BENEATH
. Any attempt to open a file outside results inOSError: [Errno 76] Capabilities insufficient
(ENOTCAPABLE
/__WASI_ERRNO_NOTCAPABLE
).getpath.py
runs into the capability issue in several places when the module attempts to read from landmark filesVENV_LANDMARK
andBUILDDIR_TXT
. On wasmtime the WASI process starts with CWD=/
(root). By default the process does not have capability to access/
. Our tests currently work around the problem by mapping on the hostSRCDIR
to/
inside the WASI environment. Without the mapping, Python startup fails withYour environment
wasm32-wasi
Fix proposal
ENOTCAPABLE
inerrno
moduleENOTCAPABLE
toPermissionError
. Insufficient capabilities is a sort of permission problem.PermissionError
additionally toFileNotFoundError
at places that readVENV_LANDMARK
andBUILDDIR_TXT
The text was updated successfully, but these errors were encountered: