Skip to content

mv: diagnose directory overwrites of symlink destinations - #15366

Merged
RenjiSann merged 1 commit into
uutils:mainfrom
limadog9:fix/mv-directory-symlink-diagnostic
Oct 15, 2026
Merged

RenjiSann merged 1 commit into
uutils:mainfrom
limadog9:fix/mv-directory-symlink-diagnostic

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

Check the destination entry without following its symlink target so missing or inaccessible referents do not fall through to a raw rename error. Extend the regression to cover existing and dangling symlinks.

Closes #15358

Check the destination entry without following its symlink target so missing
or inaccessible referents do not fall through to a raw rename error.
Extend the regression to cover existing and dangling symlinks.

Closes uutils#15358
@RenjiSann
RenjiSann merged commit 2fb77e8 into uutils:main Oct 15, 2026
100 checks passed
@RenjiSann

Copy link
Copy Markdown
Collaborator

Thanks !

Comment thread src/uu/mv/src/mv.rs
move_files_into_dir(&[source.to_path_buf()], target, opts)
}
} else if source_is_dir && target.exists() {
} else if source_is_dir && target.symlink_metadata().is_ok() {

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.

with a dangling symlink, is_writable follows it and returns false, so in a terminal we now prompt before failing, no?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You're right, I opened #15369 to address it

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: raw ENOTDIR instead of translated error under WASI

3 participants