-x implementations

John F Haugh II jfh at rpp386.cactus.org
Fri Feb 1 00:54:19 AEST 1991


In article <8896 at star.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
>If your effective uid is that of user `foo', whereas your real uid is
>that of user `bar':
>
>	$ ls -l mailbox
>	-rw-------  1 foo          1079 Jan 30 19:26 mailbox
>	$ test -r mailbox || echo 'Huh?  Is mailbox unreadable for me?'
>
>Access(2), a sick system call.  (I _know_ it uses the real uid on
>purpose.)

The question test(1) is asking is wrong.  test is supposed to return
whether or not it =is= readable, not whether it =should= be readable.

test(1) is the sick on.  Any version of test(1) which relies on
access(2) is broken.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"13 of 17 valedictorians in Boston High Schools last spring were immigrants
 or children of immigrants"   -- US News and World Report, May 15, 1990



More information about the Comp.unix.programmer mailing list