The -x (copy-one-filesystem) option does not work correctly on the cp command. For example: mkdir t cd t mkdir mntpoint mount some_file_system ./mntpoint mkdir ./mntpoint/mntpoint cp -auvfx . mntpoint And watch it recurse, copying the contents of mntpoint to itself, even though -x was supposed to prevent this from happening. This appears due to a misplaced closing curly bracket in copy.c, and is fixable by the following patch. Bug report also sent to GNU. --- fileutils-4.0/src/copy.c.orig Mon Sep 28 12:09:18 1998 +++ fileutils-4.0/src/copy.c Fri Jan 21 15:27:07 2000 @@ -668,11 +668,11 @@ if (x->verbose) printf ("%s -> %s\n", src_path, dst_path); - - /* Are we crossing a file system boundary? */ - if (x->one_file_system && device != 0 && device != src_sb.st_dev) - return 0; } + + /* Are we crossing a file system boundary? */ + if (x->one_file_system && device != 0 && device != src_sb.st_dev) + return 0; /* Copy the contents of the directory. */
Created attachment 73 [details] This patch fixes the -x option of the cp command.
Thanks, fixed.
The fix in the package breaks the -r flag.
I've taken out the patch for now - didn't have the time to fix it properly yet, and -r is more important than -x...
It's fixed in 4.0z-1.