summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-25 09:28:48 +0000
committerJim Meyering <jim@meyering.net>1998-01-25 09:28:48 +0000
commit0eba2a8dd7c62083374ca50d49f334582c627b18 (patch)
treec07d9784e5b1f59274e35ca97c078d01a52b9e1b /src/copy.c
parent7c04ce1f097dcbd487e3b80ff2c22f287fa1d0e7 (diff)
downloadcoreutils-0eba2a8dd7c62083374ca50d49f334582c627b18.tar.xz
(DO_CHOWN): Don't fail for non-root when chown fails due
not only to lack of permission (EPERM), but also to lack of support (EINVAL). Reported by Bengt Martensson.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index a764d8990..1a762df85 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -25,8 +25,9 @@
#define DO_CHOWN(Chown, File, New_uid, New_gid) \
(Chown ((File), (x->myeuid == 0 ? (New_uid) : x->myeuid), (New_gid)) \
/* If non-root uses -p, it's ok if we can't preserve ownership. \
- But root probably wants to know, e.g. if NFS disallows it. */ \
- && (errno != EPERM || x->myeuid == 0))
+ But root probably wants to know, e.g. if NFS disallows it, \
+ or if the target system doesn't support file ownership. */ \
+ && ((errno != EPERM && errno != EINVAL) || x->myeuid == 0))
struct dir_list
{