From fe6f4e305c4ae24c542c460b8abddea648c7e8d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2009 10:41:23 +0100 Subject: [PATCH] cp: fix a probably redundant chmod when setting xattrs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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" --- src/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.11.4.GIT