[PATCH] (against 1.4.2) prevent cp of dir into itself (reprise)

S H sh4d0wstr1f3 at yahoo.com
Thu Aug 23 21:16:00 UTC 2007


cp -R sub sub results in a nasty subdirectory tree (see http://bugs.busybox.net/view.php?id=1412). coreutils cp stops it before it goes out of control. FreeBSD ignores it. I prefer the coreutils behavior.

This patch approximates the coreutils behavior to the best of my knowledge, without some of the issues found in r8517.  It works by recording the source directories which are visited;
because no parent of dest can occur in source. This will only happen
with directories; and since there can't be hardlinks to directories,
this should never cause problems with the other code that uses the
ino_dev_hashtable.


The patch is against 1.4.2; if anyone is seriously interested in this, I'm happy to port it up to svn HEAD. I'm primarily seeking comments that this is on a better path than the original solution, and whether or not developers are genuinely interested in emulating the coreutils behavior in this case.

Thanks for your time.




      ____________________________________________________________________________________
Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox.quintessence.r2446M.2
Type: application/octet-stream
Size: 1355 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070823/a6983725/attachment-0002.obj 


More information about the busybox mailing list