summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOndřej Vašík <ovasik@redhat.com>2009-09-15 10:41:23 +0100
committerPádraig Brady <P@draigBrady.com>2009-09-15 10:51:13 +0100
commitfe6f4e305c4ae24c542c460b8abddea648c7e8d1 (patch)
tree98d1b7dd9a0797c0fc351a25e0a952fc70d4cad3 /src
parenta77fb35364b3d69cb79f96d04dc22e54bc62b9a4 (diff)
downloadcoreutils-fe6f4e305c4ae24c542c460b8abddea648c7e8d1.tar.xz
cp: fix a probably redundant chmod when setting xattrs
* src/copy.c (copy_reg): Fix initial value of access_changed variable. This was introduced by Pádraig Brady in commit cca83faf, 2009-09-14, "cp,mv: preserve extended attributes even for read-only files"
Diffstat (limited to 'src')
-rw-r--r--src/copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index ad2060b9c..b7d113fbe 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -839,7 +839,7 @@ copy_reg (char const *src_name, char const *dst_name,
by xattr_permission() in fs/xattr.c of the GNU/Linux kernel tree. */
if (x->preserve_xattr)
{
- bool access_changed = true;
+ bool access_changed = false;
if (!(sb.st_mode & S_IWUSR) && geteuid() != 0)
access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0;