]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Never copy through a symlink that cp has just created.
authorJim Meyering <jim@meyering.net>
Tue, 2 Oct 2007 09:10:22 +0000 (11:10 +0200)
committerJim Meyering <jim@meyering.net>
Tue, 2 Oct 2007 09:20:19 +0000 (11:20 +0200)
commit1b8c8befd96bb1ebf02eeade5029a81e1b6c4dc1
treedafaac59ecd7202330dfe333b1eae0f75687bb18
parent65ee3d963014a4c93dcf17886a7da2a8c43277b2
Never copy through a symlink that cp has just created.

* src/copy.c (copy_internal): When same-file detection requires
'stat'ing the destination file, also 'lstat' it and ensure that
it wasn't the destination of a preceding copy operation.
This bug was introduced on 2007-06-18.
* tests/cp/abuse: New test for the above.
* tests/cp/Makefile.am (TESTS): Add abuse.
ChangeLog
src/copy.c
tests/cp/Makefile.am
tests/cp/abuse [new file with mode: 0755]