]> git.ipfire.org Git - thirdparty/coreutils.git/commit
cp: ensure --remove-destination doesn't traverse symlinks
authorPádraig Brady <P@draigBrady.com>
Fri, 4 May 2018 04:19:15 +0000 (21:19 -0700)
committerPádraig Brady <P@draigBrady.com>
Tue, 15 May 2018 16:52:44 +0000 (09:52 -0700)
commita391007511cebe4a1731d85b4808499293c67173
tree5c05e51d230fa7bf8dffdfeab81c16cb5003746a
parent694d10b71e418ef4ea68847185b73544fe03eae2
cp: ensure --remove-destination doesn't traverse symlinks

* src/cp.c (target_directory_operand): Allow through inaccessible
arguments with -f or --remove.
* doc/coreutils.texi (cp invocation): Clarify that -f doesn't directly
impact the removal of non-traversable symlinks.
* tests/cp/dir-rm-dest.sh: Test the new behavior.
* tests/cp/thru-dangling.sh: Enforce -f behavior wrt symlinks.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/31335
NEWS
doc/coreutils.texi
src/cp.c
tests/cp/dir-rm-dest.sh
tests/cp/thru-dangling.sh