Skip to content

mv: fix the remaining TOCTOU#12170

Open
sylvestre wants to merge 5 commits into
uutils:mainfrom
sylvestre:toctou-mv
Open

mv: fix the remaining TOCTOU#12170
sylvestre wants to merge 5 commits into
uutils:mainfrom
sylvestre:toctou-mv

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/mv/meta-to-xpart is no longer failing!
Congrats! The gnu test tests/tail/truncate is no longer failing!
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Congrats! The gnu test tests/cut/bounded-memory is now passing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@sylvestre sylvestre changed the title Toctou mv mv: fix the remaining TOCTOU May 6, 2026
@sylvestre sylvestre force-pushed the toctou-mv branch 3 times, most recently from 5104ad4 to 4b25319 Compare May 7, 2026 06:44
@sylvestre sylvestre requested review from RenjiSann and cakebaker May 7, 2026 06:53
@sylvestre sylvestre marked this pull request as ready for review May 7, 2026 06:53
Comment thread tests/by-util/test_mv.rs Outdated
sylvestre added 2 commits May 11, 2026 23:10
uutils#10010)

EXDEV fallback now catches AlreadyExists and replaces the destination
via temp-name + fs::rename. Matches GNU mv.
Add fsxattr::copy_xattrs_fd; mv's EXDEV fallback opens src/dst with
O_NOFOLLOW via safe_copy and copies content + xattrs on the live fds,
pinning both inodes against a concurrent renamer.
Restore strict ENOTSUP/EOPNOTSUPP propagation on copy_xattrs and
copy_xattrs_fd; add copy_xattrs_ignore_unsupported and
copy_xattrs_fd_ignore_unsupported wrappers for best-effort callers.
mv uses the wrappers; cp --preserve=xattr exits 1 on ENOTSUP again.
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.

2 participants