Skip to content

Commit

Permalink
[autorelease] Only mount accessible directories in /.
Browse files Browse the repository at this point in the history
Otherwise running any tools fails with an obscure wasmtime message
about preopens on wasmtime>=21.

This is similar to the change in commit c26c8d4.
  • Loading branch information
whitequark committed May 20, 2024
1 parent cdf5e9d commit 0afc7e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yowasp_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def run_wasm(__package__, wasm_filename, *, resources=[], argv):
else:
# can't do this for files, but no one's going to use yowasp on files in / anyway
for path in os.listdir("/"):
if os.path.isdir("/" + path):
if os.path.isdir("/" + path) and os.access("/" + path, os.R_OK):
wasi_cfg.preopen_dir("/" + path, "/" + path)

# preopens for relative paths
Expand Down

0 comments on commit 0afc7e5

Please sign in to comment.