nodejs / nodejs/uvwasi

Path resolution should be consistent with WASI spec

Open
#293 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
270
Forks
60
PR merge metrics
No merged PRs in 30d

Description

Currently, in functions such as path_open, uvwasi first normalizes the path. For example, a path such as a/./../a/b would be normalized to a/b before calling the underlying OS syscall.

This behavior is inconsistent with the WASI documentation, which specifies that path components should be resolved one by one.

This causes seemingly simple WASI calls to behave differently on Node (uvwasi) and many other runtimes like Wasmtime, WasmEdge, etc. For example, a path_open call that tries to create a file a/. will fail on Wasmtime while it succeeds on Node.

@cjihrig has previously suggested a path forward in #269. I just want to open a dedicated issue to track this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WASI path-resolution documentation and the suggested path forward in issue #269. Inspect path_open and related path-handling functions before the underlying OS syscall. Done means path components are resolved one by one, including cases such as creating a file at a/. , so behavior matches the WASI specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.