+2007-03-03 Andrew Church <achurch@achurch.org> (tiny change)
+ Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix a bug: cp -x would fail to set mount point permissions.
+ * NEWS: mention cp -x bug fix
+ * src/copy.c (copy_internal): Don't return immediately after
+ copying a mount point that we do not intend to recurse under.
+ Based on a patch by Andrew Church.
+
2007-03-03 Jim Meyering <jim@meyering.net>
pwd-unreadable-parent: Skip test on ia64/Linux, too.
** Bug fixes
+ cp -x (--one-file-system) would fail to set mount point permissions
+
The default block size and output format for df -P are now unaffected by
the DF_BLOCK_SIZE, BLOCK_SIZE, and BLOCKSIZE environment variables. It
is still affected by POSIXLY_CORRECT, though.
emit_verbose (src_name, dst_name, NULL);
}
- /* Are we crossing a file system boundary? */
+ /* Decide whether to copy the contents of the directory. */
if (x->one_file_system && device != 0 && device != src_sb.st_dev)
- return true;
-
- /* Copy the contents of the directory. */
-
- if (! copy_dir (src_name, dst_name, new_dst, &src_sb, dir, x,
- copy_into_self))
{
- /* Don't just return here -- otherwise, the failure to read a
- single file in a source directory would cause the containing
- destination directory not to have owner/perms set properly. */
- delayed_ok = false;
+ /* Here, we are crossing a file system boundary and cp's -x option
+ is in effect: so don't copy the contents of this directory. */
+ }
+ else
+ {
+ /* Copy the contents of the directory. Don't just return if
+ this fails -- otherwise, the failure to read a single file
+ in a source directory would cause the containing destination
+ directory not to have owner/perms set properly. */
+ delayed_ok = copy_dir (src_name, dst_name, new_dst, &src_sb, dir, x,
+ copy_into_self);
}
}
else if (x->symbolic_link)