From: Jim Meyering Date: Fri, 18 Aug 2000 07:08:04 +0000 (+0000) Subject: (DO_CHOWN): Do not make a special case for non-root. X-Git-Tag: FILEUTILS-4_0y~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=169618899316983100d6d3891a002a1178cefa3f;p=thirdparty%2Fcoreutils.git (DO_CHOWN): Do not make a special case for non-root. POSIX.2 requires that cp -p and mv attempt to set the uid of the destination file, even if you're not root. This affects behavior only on hosts that let you give files away via chmod. --- diff --git a/src/copy.c b/src/copy.c index ef3ab174ff..207e19c194 100644 --- a/src/copy.c +++ b/src/copy.c @@ -38,10 +38,10 @@ #include "same.h" #define DO_CHOWN(Chown, File, New_uid, New_gid) \ - (Chown ((File), (x->myeuid == 0 ? (New_uid) : x->myeuid), (New_gid)) \ + (Chown (File, New_uid, 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, \ - or if the target system doesn't support file ownership. */ \ + or if the target system doesn't support file ownership. */ \ && ((errno != EPERM && errno != EINVAL) || x->myeuid == 0)) struct dir_list