cp: preserve existing permissions with --no-preserve=mode
commit5e7b8928b76e6d661a6babd884dc812348255f59
authorPádraig Brady <P@draigBrady.com>
Sun, 3 Jun 2018 23:19:20 +0000 (3 16:19 -0700)
committerPádraig Brady <P@draigBrady.com>
Sun, 3 Jun 2018 23:27:37 +0000 (3 16:27 -0700)
tree584d6137f5b8a321fc85efea028a6b2521036337
parentc8eb21c9c0ba00559afc5e0d200085ac656396e0
cp: preserve existing permissions with --no-preserve=mode

This issue was introduced in commit v8.19-145-g24ebca6

* src/copy.c (copy_internal): With --no-preserve=mode,
only reset permissions for newly created files.
(copy_reg): Likewise.
* NEWS: Mention the fix.
* tests/cp/preserve-mode.sh: Add a test case.
Fixes https://bugs.gnu.org/31675
NEWS
src/copy.c
tests/cp/preserve-mode.sh