diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-07-29 17:13:28 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-07-29 17:13:28 +0000 |
commit | 528fe6e50441461271655ed8adf933c65597ee3c (patch) | |
tree | 693d56d5d0b1036f71e83d4727c56e06cf8e3891 | |
parent | aa24517b5f810c7d2c913a22c0c9714983af8116 (diff) | |
download | coreutils-528fe6e50441461271655ed8adf933c65597ee3c.tar.xz |
(set_author): Preserve the st_author field via the
file descriptor dest_desc.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/copy.c | 5 |
2 files changed, 9 insertions, 2 deletions
@@ -1,7 +1,13 @@ +2006-07-29 Paul Eggert <eggert@cs.ucla.edu> + + * src/copy.c (set_author): Preserve the st_author field via the + file descriptor dest_desc. + 2006-07-28 Paul Eggert <eggert@cs.ucla.edu> * NEWS: chmod now preserves setuid and setgid bits on directories if you use a numeric mode with them clear, e.g., "chmod 755 DIR". + Fix test case problems if working directory is setgid, reported by Bob Proulx. * tests/cp/fail-perm: Use symbolic mode so that we clear diff --git a/src/copy.c b/src/copy.c index ac54e48a1..3bd29e285 100644 --- a/src/copy.c +++ b/src/copy.c @@ -213,10 +213,11 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc, static void set_author (const char *dst_name, int dest_desc, const struct stat *src_sb) { - /* FIXME: Preserve the st_author field via the file descriptor dest_desc. */ #if HAVE_STRUCT_STAT_ST_AUTHOR /* Preserve the st_author field. */ - file_t file = file_name_lookup (dst_name, 0, 0); + file_t file = (dest_desc < 0 + ? file_name_lookup (dst_name, 0, 0) + : getdport (dest_desc)); if (file == MACH_PORT_NULL) error (0, errno, _("failed to lookup file %s"), quote (dst_name)); else |