NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/40336: cp(1) -p man page detail out of sync with present reality



>Number:         40336
>Category:       bin
>Synopsis:       cp(1) -p man page detail out of sync with present reality
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 07 07:00:00 +0000 2009
>Originator:     David H. Gutteridge
>Release:        NetBSD 5.0_BETA
>Organization:
>Environment:


NetBSD arcusiii.nonus-porta.net 5.0_BETA NetBSD 5.0_BETA (ARCUSIII) #1: Sun 
Nov 30 14:34:57 EST 2008  
disciple%arcusiii.nonus-porta.net@localhost:/home/disciple/build/netbsd-5/usr/src/sys/arch/i386/compile/ARCUSIII
 
i386
>Description:
Hello,

The man page for cp(1) says of the -p option: "If the user ID and group ID
cannot be preserved, no error message is displayed and the exit value is not
altered."  This doesn't seem to be true for the last two major releases of
NetBSD:

[disciple@arcusv:disciple]$ uname -a
NetBSD arcusv.nonus-porta.net 4.0_STABLE NetBSD 4.0_STABLE (ARCUSV) #0: Mon 
Oct  6 00:47:08 EDT 2008  
disciple%arcusiii.nonus-porta.net@localhost:/home/disciple/build/netbsd-4/usr/src/sys/arch/macppc/compile/obj/ARCUSV
 
macppc
[disciple@arcusv:disciple]$ su -
Password:
[root@arcusv:root]# mount_msdos /dev/sd0a /mnt
[root@arcusv:root]# cp -p 
/home/disciple/Matisse_The_Girl_With_The_Green_Eyes.jpg /mnt/test/
cp: chown: /mnt/test/Matisse_The_Girl_With_The_Green_Eyes.jpg: Invalid 
argument
[root@arcusv:root]# echo $?
1
[root@arcusv:root]# cd /mnt/test/
[root@arcusv:test]# ls -l
total 288
-rwxr-xr-x  1 root  wheel  140712 Jan 31  2005 
Matisse_The_Girl_With_The_Green_Eyes.jpg

[disciple@arcusiii:disciple]$ uname -a
NetBSD arcusiii.nonus-porta.net 5.0_BETA NetBSD 5.0_BETA (ARCUSIII) #1: Sun 
Nov 30 14:34:57 EST 2008  
disciple%arcusiii.nonus-porta.net@localhost:/home/disciple/build/netbsd-5/usr/src/sys/arch/i386/compile/ARCUSIII
 
i386
[disciple@arcusiii:disciple]$ su -
Password:
[root@arcusiii:root]# mount_msdos /dev/sd0e /mnt
[root@arcusiii:root]# cp -p /home/disciple/scale.wav /mnt/test/
cp: chown: /mnt/test/scale.wav: Invalid argument
[root@arcusiii:root]# echo $?
1
[root@arcusiii:root]# cd /mnt/test
[root@arcusiii:test]# ls -l
total 2896
-rwxr-xr-x  1 root  wheel  1477164 Jul 21  2007 scale.wav

If I recall correctly, the statement in the man page was true for NetBSD 
1.6.x
and 3.x, so something presumably has changed after that time.  (I mention 
this
in part because it violates the "principle of least surprise", though I 
can't
say I'm particularly fussed about it.)

(It appears the POSIX standard states this behaviour is undefined.  "The 
user
ID and group ID. If this duplication fails for any reason, it is unspecified
whether cp writes a diagnostic message to standard error."
[http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html])

Regards,

Dave

>How-To-Repeat:

>Fix:


>Unformatted:
 
 


Home | Main Index | Thread Index | Old Index