Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WASI] getpath.py does not handle "Capabilities insufficient" (ENOTCAPABLE) #96005

Closed
Assignees
brettcannonzooba
Labels
3.11only security fixes3.12only security fixesOS-wasitype-bugAn unexpected behavior, bug, or error
@tiran

Description

@tiran

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 withopenat2(2) with flagsRESOLVE_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 with

Exception ignored error evaluating path:Traceback (most recent call last):  File "<frozen getpath>", line 353, in <module>OSError: [Errno 76] Capabilities insufficientFatal Python error: error evaluating pathPython runtime state: core initialized

Your environment

wasm32-wasi

Fix proposal

  • exposeENOTCAPABLE inerrno module
  • mapENOTCAPABLE toPermissionError. Insufficient capabilities is a sort of permission problem.
  • catchPermissionError additionally toFileNotFoundError at places that readVENV_LANDMARK andBUILDDIR_TXT

Metadata

Metadata

Labels

3.11only security fixes3.12only security fixesOS-wasitype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp