From: Ondřej Vašík Date: Tue, 15 Sep 2009 09:41:23 +0000 (+0100) Subject: cp: fix a probably redundant chmod when setting xattrs X-Git-Tag: v8.0~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe6f4e305c4ae24c542c460b8abddea648c7e8d1;p=thirdparty%2Fcoreutils.git 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" --- diff --git a/src/copy.c b/src/copy.c index ad2060b9c4..b7d113fbea 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;