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] getpath.py does not handle "Capabilities insufficient" (ENOTCAPABLE) #96005
Labels
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 <christian@python.org>
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


tiran commentedAug 15, 2022
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.pyruns into the capability issue in several places when the module attempts to read from landmark filesVENV_LANDMARKandBUILDDIR_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 hostSRCDIRto/inside the WASI environment. Without the mapping, Python startup fails withYour environment
wasm32-wasiFix proposal
ENOTCAPABLEinerrnomoduleENOTCAPABLEtoPermissionError. Insufficient capabilities is a sort of permission problem.PermissionErroradditionally toFileNotFoundErrorat places that readVENV_LANDMARKandBUILDDIR_TXTThe text was updated successfully, but these errors were encountered: