You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WASI] getpath.py does not handle "Capabilities insufficient" (ENOTCAPABLE) #96005
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 in OSError: [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 files VENV_LANDMARK and BUILDDIR_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 host SRCDIR to / inside the WASI environment. Without the mapping, Python startup fails with
Activity
pythongh-96005: Handle WASI ENOTCAPABLE in getpath
brettcannon commentedon Aug 16, 2022
SGTM!
gh-96005: Handle WASI ENOTCAPABLE in getpath (GH-96006)
pythongh-96005: Handle WASI ENOTCAPABLE in getpath (pythonGH-96006)
pythongh-96005: FreeBSD has ENOTCAPABLE, too
gh-96005: FreeBSD has ENOTCAPABLE, too (GH-96034)
pythongh-96005: FreeBSD has ENOTCAPABLE, too (pythonGH-96034)
[3.11] gh-96005: Handle WASI ENOTCAPABLE in getpath (GH-96006) (GH-96034
brettcannon commentedon Sep 23, 2022
Can this issue be closed, or is there something still to do?
brettcannon commentedon Oct 21, 2022
@tiran all good to close this?