summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-08-18 07:08:04 +0000
committerJim Meyering <jim@meyering.net>2000-08-18 07:08:04 +0000
commit169618899316983100d6d3891a002a1178cefa3f (patch)
tree2b7e6f5dea4bb0434a3746c99288b4dd4191ceec /src/copy.c
parent3804c0288a3f888d623091794792ec4b8b22637b (diff)
downloadcoreutils-169618899316983100d6d3891a002a1178cefa3f.tar.xz
(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.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index ef3ab174f..207e19c19 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