Skip to content

mv: diagnose trailing slashes on regular-file sources - #15379

Merged
sylvestre merged 1 commit into
uutils:mainfrom
limadog9:fix/mv-source-trailing-slash-wasi
Oct 17, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
limadog9:fix/mv-source-trailing-slash-wasi

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

Reject a trailing slash on a regular-file source when WASI incorrectly accepts its metadata. Strengthen the existing regression and include it in WASI CI.

Closes #15370.

Comment thread src/uu/mv/src/mv.rs Outdated
};

// WASI may return file metadata for a trailing-slash path instead of ENOTDIR.
if source_metadata.is_file() && path_ends_with_terminator(source) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be merged into the let-else above with a .filter(...), no? it's the same error twice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the metadata check into .filter(...) on the let-else, removing the duplicated error handling. Native and WASI tests pass; squashed and pushed.

@limadog9
limadog9 force-pushed the fix/mv-source-trailing-slash-wasi branch from 974e041 to 4eeeeb7 Compare October 16, 2026 13:30
test_ls::test_ls_a_dotdot_no_error_on_wasi \
test_ls::test_ls_al_no_capabilities_insufficient_on_wasi \
test_md5sum:: test_mkdir:: test_mktemp:: test_nl:: test_nproc:: test_numfmt:: test_od:: \
test_mv::test_mv_dir_into_file_where_both_are_files \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be necessary if we merged #15320 as we will run the whole mv command integration tests.

@sylvestre
sylvestre merged commit a51c6e5 into uutils:main Oct 17, 2026
104 of 105 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mv a/ b: raw ENOTDIR surfaces under WASI instead of the translated "cannot stat" message

3 participants