Xref: utzoo comp.unix.programmer:944 alt.sources.d:1410 Path: utzoo!utgpu!cs.utexas.edu!usc!jarthur!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.programmer,alt.sources.d Subject: Re: -x implementations Message-ID: <8896@star.cs.vu.nl> Date: 30 Jan 91 19:36:38 GMT References: <1943:Jan2619:34:3591@kramden.acf.nyu.edu> <2856@charon.cwi.nl> <8869@star.cs.vu.nl> <1991Jan29.153242.12335@convex.com> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 34 In article <1991Jan29.153242.12335@convex.com>, tchrist@convex.COM (Tom Christiansen) writes: )From the keyboard of maart@cs.vu.nl (Maarten Litmaath): ):How does Perl implement `-x', Tom? ) )It does its own stat, and then does the bit compares itself to )determine accessibility; it does not use access(2). Good! )Note that both -x and -X exist for checking effective and real IDs )respectively; likewise -r/-R, -w/-W, and -o/-O. Does this solve )your problem? I guess so. )Could you show me some, um, test cases where /bin/test )fails so I can see what perl does under the same circumstances? As root: $ test -x /etc/passwd && echo 'Huh? /etc/passwd is executable?' 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.) -- Temporary files like /tmp/sh$$ are an abomination.