]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cp,mv,install: fix chmod on Linux CIFS
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Sep 2023 20:27:45 +0000 (13:27 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Sep 2023 20:28:23 +0000 (13:28 -0700)
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.

NEWS
src/copy.c

diff --git a/NEWS b/NEWS
index 6801832f776a16af337cb20d5f3d76ed9cc71c65..2adea1e11f44912d043d1b3275c48563f39fe55b 100644 (file)
--- 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]
index 0b3de04f34570349279af78bd5ab37dd80f69ecc..9f1f3e85a869a6721fdc820e24a6cd03b4769e29 100644 (file)
@@ -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.