From: Paul Eggert Date: Sat, 2 Sep 2023 20:27:45 +0000 (-0700) Subject: cp,mv,install: fix chmod on Linux CIFS X-Git-Tag: v9.5~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cd52bd9993163c2ef8b3d62b757c573fb5320df;p=thirdparty%2Fcoreutils.git cp,mv,install: fix chmod on Linux CIFS This bug occurs only when temporarily setting the mode to the intersection of old and new modes when changing ownership. * src/copy.c (owner_failure_ok): Treat EACCES like EPERM. --- diff --git a/NEWS b/NEWS index 6801832f77..2adea1e11f 100644 --- a/NEWS +++ b/NEWS @@ -4,9 +4,9 @@ GNU coreutils NEWS -*- outline -*- ** Bug fixes - cp, mv, install no longer issue spurious "failed to preserve ownership" - diagnostics when copying to GNU/Linux CIFS filesystems. They do - this by working around a Linux CIFS bug. + cp, mv, and install no longer issue spurious diagnostics like "failed + to preserve ownership" when copying to GNU/Linux CIFS file systems. + They do this by working around some Linux CIFS bugs. numfmt options like --suffix no longer have an arbitrary 127-byte limit. [bug introduced with numfmt in coreutils-8.21] diff --git a/src/copy.c b/src/copy.c index 0b3de04f34..9f1f3e85a8 100644 --- a/src/copy.c +++ b/src/copy.c @@ -3468,7 +3468,8 @@ chown_failure_ok (struct cp_options const *x) static bool owner_failure_ok (struct cp_options const *x) { - return ((errno == EPERM || errno == EINVAL) && !x->owner_privileges); + return ((errno == EPERM || errno == EINVAL || errno == EACCES) + && !x->owner_privileges); } /* Return the user's umask, caching the result.