From: Jim Meyering Date: Sun, 25 Jan 1998 09:28:48 +0000 (+0000) Subject: (DO_CHOWN): Don't fail for non-root when chown fails due X-Git-Tag: FILEUTILS-3_16l~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0eba2a8dd7c62083374ca50d49f334582c627b18;p=thirdparty%2Fcoreutils.git (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. --- diff --git a/src/copy.c b/src/copy.c index a764d8990f..1a762df856 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 {