mv a/ b: raw ENOTDIR surfaces under WASI instead of the translated "cannot stat" message
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start in handle_two_paths in src/uu/mv/src/mv.rs, where the trailing-slash source check relies on symlink_metadata() failing with ENOTDIR. Then run test_mv_dir_into_file_where_both_are_files in tests/by-util/test_mv.rs under the wasi_runner, which is currently skipped. Done means the translated 'cannot stat' message appears under WASI and the skip is removed. Pull request #15379 is already open against this, so check it before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
mv with a trailing slash on a non-directory source should fail with the translated cannot stat '<path>': Not a directory message, matching native behavior. Under the WASI sandbox, a raw ENOTDIR surfaces instead.
Found while enabling WASI integration tests for mv in #15320; the affected test (test_mv_dir_into_file_where_both_are_files in tests/by-util/test_mv.rs) is currently skipped under wasi_runner with this note.
Likely cause: handle_two_paths in src/uu/mv/src/mv.rs relies on source.symlink_metadata() failing with ENOTDIR when source has a
trailing slash but names a non-directory — that's how native stat(2) enforces the POSIX "trailing slash requires the final component to resolve to a directory" rule. Under wasmtime, symlink_metadata() on a trailing-slash path over a regular file does not fail, so the code treats the source as a normal (non-directory) path and falls through to the plain rename() call, where the raw ENOTDIR from the underlying syscall is returned unwrapped.
This is the same root cause category as #15358 (WASI's stat not enforcing the trailing-slash rule), but on the source side with a plain file rather than a symlink destination.
To reproduce under wasmtime:
touch a
touch b
mv a/ b
Expected: mv: cannot stat 'a/': Not a directory
Actual (WASI): mv: Not a directory (os error 54)
- Lingua principale
- Rust
- Stelle
- 24.3k
- Fork
- 2.1k
- Merge medio
- 2g 28m
- PR unite (30g)
- 313
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/coreutils
-
fmt -p: an unprefixed last line without a newline gets one addedForse già presa @fixfon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
numfmt: a tab between fields is kept, GNU prints a spaceForse già presa @fixfon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
minorbug(mv): invalid mode errors not quotedForse già presa @henrimarconni l’ha presa 5 giorni fa. ApertaU - mv
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
ptx: break file missing path in error messageForse già presa @Franklin-Qi l’ha presa 5 giorni fa. ApertaU - ptx
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
uutils/coreutils#15307 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
minorbug(stat): os errno not stripped when failing to flush stdoutForse già presa @cestercian l’ha presa 12 giorni fa. ApertaU - stat
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
uutils/coreutils#15200 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/coreutils
Issue simili
-
proxy: include denial_category in the "proxy request denied" log lineForse già presa @sreyas-endor l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
nolabs-ai/nono#2172 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
metasequoiaime/msime#9113 ·
I maintainer di solito rispondono entro 1 giorno
-
area:desktop priority:p2 type:chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
area: supply-chain
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100