>From f1de9740e663181ef6a303118364545ced043c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 2 Jun 2017 21:50:04 -0700 Subject: [PATCH] copy: don't fail when unable to chown symlinks * src/copy.c (copy_internal): Honor the x->require_preserve flag for symlinks as we do for ordinary files, so we don't exit with failure upon failure to chown a symbolic link. * NEWS: Mention the bug fix. --- NEWS | 5 +++++ src/copy.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7c4429d..c811dbc 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,11 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes + cp and mv now only warn about failure to preserve ownership of symlinks. + cp (without -p) will no longer exit with a failure status, and mv will + also no longer leave such symlinks remaining in the source file system. + [the bug dates back to the initial implementation] + date and touch no longer overwrite the heap with large user specified TZ values (CVE-2017-7476). [bug introduced in coreutils-8.27] diff --git a/src/copy.c b/src/copy.c index e96ecdd..965e819 100644 --- a/src/copy.c +++ b/src/copy.c @@ -2714,7 +2714,8 @@ copy_internal (char const *src_name, char const *dst_name, { error (0, errno, _("failed to preserve ownership for %s"), dst_name); - goto un_backup; + if (x->require_preserve) + goto un_backup; } else { -- 2.9.3