1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-17 02:31:02 +00:00

cp: add support POSIXLY_CORRECT=1 when dealing with dangling links

GNU: tests/cp/thru-dangling.sh
This commit is contained in:
Sylvestre Ledru 2023-05-01 10:54:14 +02:00
parent 70b69efadb
commit 2d4dfc3d7d
2 changed files with 12 additions and 0 deletions

View file

@ -1498,6 +1498,7 @@ fn copy_file(
options.overwrite,
OverwriteMode::Clobber(ClobberMode::RemoveDestination)
)
&& std::env::var_os("POSIXLY_CORRECT").is_none()
{
return Err(Error::Error(format!(
"not writing through dangling symlink '{}'",