[EMAIL PROTECTED] (Andrew Church) writes: > The following patch may or may not be correct, but it seems to > solve the problem for my case.
Thanks for catching this problem. Too bad it's hard to write a portable test case for it. The patch looks correct to me, but how about this patch instead? It tries to make the code a bit clearer (and a tiny bit faster). 2007-03-03 Paul Eggert <[EMAIL PROTECTED]> * src/copy.c (copy_internal): Don't return immediately after copying a mount point that we do not intend to recurse under. This fixes a bug where we didn't set the correct permissions for the mount point. Problem reported by Andrew Church. diff --git a/src/copy.c b/src/copy.c index 000c248..8de4f80 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1604,19 +1604,16 @@ copy_internal (char const *src_name, char const *dst_name, emit_verbose (src_name, dst_name, NULL); } - /* Are we crossing a file system boundary? */ - 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)) + /* Are we staying in the file system, or do we not care? */ + if (! x->one_file_system || device == 0 || device == src_sb.st_dev) { - /* 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; + /* 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) M ChangeLog M src/copy.c Committed as 293658fb3621376f0b51c54f1258d67dbb40d090 _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils