1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-18 13:21:58 +02:00

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"
This commit is contained in:
Ondřej Vašík
2009-09-15 10:41:23 +01:00
committed by Pádraig Brady
parent a77fb35364
commit fe6f4e305c

View File

@@ -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;