From: Pádraig Brady
Date: Sat, 3 Jun 2017 04:50:04 +0000 (-0700) Subject: copy: don't fail when unable to chown symlinks X-Git-Tag: v8.28~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1de9740e663181ef6a303118364545ced043c13;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/NEWS b/NEWS index 7c4429ddc4..c811dbcb50 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 e96ecdd546..965e8190db 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 {