Subject: Re: bugs and/or misfeatures in namei changes
To: None <current-users@NetBSD.ORG>
From: Greg A. Woods <woods@kuma.web.net>
List: current-users
Date: 05/18/1997 15:10:30
[ On Sun, May 11, 1997 at 18:32:56 (-0400), der Mouse wrote: ]
> Subject: Re: bugs and/or misfeatures in namei changes
>
> Why is the POSIX way necessarily Right? If POSIX requires this bizarre
> behavior of cp, as described by several people, then I think POSIX is
> broken badly enough that conformance to this aspect of it is not worth
> the damage it requires.
Indeed. This is one major stupid mistake made by POSIX that doesn't
even seem to have a rationale (at least D11.2 didn't explain this choice
so far as I can find -- perhaps it relies on 1003.1?).
I note that there are still some strange corners in NetBSD with this
stuff.
NetBSD 1.2E-970516 this happens:
14:48 [3] $ uname -srm
NetBSD 1.2E i386
14:48 [4] $ cp .profile tmp/no-such-directory-is-here/
14:49 [5] $ ls tmp/no-such-directory-is-here/
ls: tmp/no-such-directory-is-here/: Not a directory
14:49 [6] $ ls tmp/no-such-directory-is-here
tmp/no-such-directory-is-here
14:49 [7] $ rm tmp/no-such-directory-is-here/
14:58 [21] $ ls tmp/no-such-directory-is-here
ls: tmp/no-such-directory-is-here: No such file or directory
Note that rm behaves like cp in terms of ignoring the trailing slash.
Also note that ls doesn't return a non-zero exit code in the last
example where the file doesn't exist (nor in the first example, for that
matter).
On SunOS-4.1.4 the following happens, which is perhaps more self
consistent, though definitely unexpected:
14:56 [139] $ uname -srm
SunOS 4.1.4 sun4m
14:56 [140] $ ls tmp/no-such-directory-is-here/
ls: tmp/no-such-directory-is-here/: No such file or directory
ksh: exit code: 2
14:56 [141] $ cp .profile tmp/no-such-directory-is-here/
14:56 [142] $ ls tmp/no-such-directory-is-here/
tmp/no-such-directory-is-here/
14:57 [143] $ ls tmp/no-such-directory-is-here
tmp/no-such-directory-is-here
14:57 [144] $ rm tmp/no-such-directory-is-here/
14:57 [145] $ ls tmp/no-such-directory-is-here
ls: tmp/no-such-directory-is-here: No such file or directory
ksh: exit code: 2
--
Greg A. Woods
+1 416 443-1734 VE3TCP robohack!woods
Planix, Inc. <woods@planix.com>; Secrets Of The Weird <woods@weird.com>