Subject: bin/21253: cpio does recursive copy when it shouldn't
To: None <gnats-bugs@gnats.netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 04/21/2003 22:54:28
>Number:         21253
>Category:       bin
>Synopsis:       cpio does recursive copy when it shouldn't
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 21 20:55:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Manuel Bouyer
>Release:        NetBSD 1.6R
>Organization:

>Environment:
	
System: NetBSD rochebonne.antioche.eu.org 1.6R NetBSD 1.6R (ROCHEBONNE) #0: Sat Apr 19 16:12:21 MEST 2003 bouyer@rochebonne.antioche.eu.org:/usr/src/current/src/sys/arch/i386/compile/ROCHEBONNE i386
Architecture: i386
Machine: i386
>Description:
	cpio does recursive copy when given a directory:
rochebonne# echo /bin | cpio -pdmuv /mnt
/mnt/bin/[
/mnt/bin/cat
/mnt/bin/chio
/mnt/bin/chmod
/mnt/bin/cp
/mnt/bin/csh
/mnt/bin/date
/mnt/bin/dd
/mnt/bin/df
/mnt/bin/domainname
/mnt/bin/echo
/mnt/bin/ed
/mnt/bin/expr
/mnt/bin/hostname
/mnt/bin/kill
/mnt/bin/ln
/mnt/bin/ls
/mnt/bin/mkdir
/mnt/bin/mt
/mnt/bin/mv
/mnt/bin/pax
/mnt/bin/ps
/mnt/bin/pwd
/mnt/bin/rcp
/mnt/bin/rm
/mnt/bin/rmail
/mnt/bin/sh
/mnt/bin/sleep
/mnt/bin/stty
/mnt/bin/sync
/mnt/bin/test
/mnt/bin/ksh
/mnt/bin/rcmd
/mnt/bin/rmdir
/mnt/bin/systrace
/mnt/bin/tar
/mnt/bin/cpio

	This is on a recent (less than 2 days ago), I also get this on a
	sgimips running sources from Mar 25. 1.6.1 isn't affected.

	This is serious, as it'll likely break scripts. In my case is
	started doing a copy of my whole tree when I wanted only the
	root filesystem (find / -xdev | cpio ...)

>How-To-Repeat:
	echo /bin | cpio -pdmuv /tmp
>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted: