summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-07-03 19:57:42 +0000
committerJim Meyering <jim@meyering.net>1998-07-03 19:57:42 +0000
commit6ccae5e2d8b22b97045879930d18f91aaadd685a (patch)
tree6d4b8b6e154f5fc9269f4494b7a40426d4b94629 /src
parent31f6e2b228de2e403db77be5577b8203ea9f331d (diff)
downloadcoreutils-6ccae5e2d8b22b97045879930d18f91aaadd685a.tar.xz
(copy_internal): Don't call chown on a symlink.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/copy.c b/src/copy.c
index 6ffecbb2c..163722189 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -34,13 +34,6 @@
#include "cp-hash.h"
#include "path-concat.h"
-/* On Linux (from slackware-1.2.13 to 2.0.2?) there is no lchown function.
- To change ownership of symlinks, you must run chown with an effective
- UID of 0. */
-#ifdef __linux__
-# define ROOT_CHOWN_AFFECTS_SYMLINKS
-#endif
-
#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. \
@@ -762,26 +755,10 @@ copy_internal (const char *src_path, const char *dst_path,
goto un_backup;
}
# else
-# ifdef ROOT_CHOWN_AFFECTS_SYMLINKS
- if (x->myeuid == 0)
- {
- if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
- {
- error (0, errno, _("preserving ownership for %s"), dst_path);
- goto un_backup;
- }
- }
- else
- {
- /* FIXME: maybe give a diagnostic: you must be root
- to preserve ownership and group of symlinks. */
- }
-# else
/* Can't preserve ownership of symlinks.
FIXME: maybe give a warning or even error for symlinks
in directories with the sticky bit set -- there, not
preserving owner/group is a potential security problem. */
-# endif
# endif
}