+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
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