[BusyBox] /bin/cp and special files

Glenn McGrath bug1 at optushome.com.au
Sun Sep 15 23:24:03 UTC 2002


On Thu, 12 Sep 2002 18:12:25 -0700 (PDT)
Jim Treadway <jim at stardot-tech.com> wrote:

> 
> I just noticed that cp calls mknod if the source file is a device file
> or socket, mkfifo if the source file is a FIFO, and symlink if the
> source file is a symlink.
> 
> In other words, the destination file ends up being the same type as the 
> source file instead of a new regular file.
> 
> I'm not sure what the "correct" behavior, but Busybox behaves
> differently from my Red Hat boxes.
> 
> Just curious if there is a reason for this...
> Jim
>

Looks like a bug

The simple patch attached looks to fix it, needs more testing though to
make sure it doesnt break any other conditions.


Glenn
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cp.diff
Url: http://lists.busybox.net/pipermail/busybox/attachments/20020915/3d14b15e/attachment.diff 


More information about the busybox mailing list