From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id EAA10888 for ; Wed, 17 Jul 1996 04:02:23 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA03877; Tue, 16 Jul 1996 13:54:21 -0400 (EDT) Resent-Date: Tue, 16 Jul 1996 13:52:46 -0400 (EDT) From: "Colin Holmes" Message-Id: <9607161057.ZM17052@fuligin.loni.ucla.edu> Date: Tue, 16 Jul 1996 10:57:21 -0700 X-Mailer: Z-Mail (3.2.2 10apr95 MediaMail) To: zsh-users@math.gatech.edu Subject: Re: [[ -x ]] and root Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"C7XdM1.0.wx.jRzwn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/300 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi again, I started this thread looking for a way to do a [[ -x file]] while running as root. I got responses from this list (Zefram, mostly) to the effect that access() was improperly functioning under Irix 5.3, as it was under Linux. I posted to comp.sys.sgi.bug to find out what they thought and here are the more useful results.... Response 1: In article <4sedhv$305q@uni.library.ucla.edu>, holmes@alzabo.loni.ucla.edu write s: > Anyone reported that the access() call in the system library > behaves improperly with regard to root? This has been a > problem for me while writing root scripts under zsh. Are you confident that zsh uses access(2) in its test -x implementation? That would be a mistake, I believe. The access(2) system call is intended for use by setuid executables, trying to determine if the real id of the process, as opposed to the effective, could access a particular file. Implementations of test -x should stat and look at mode bits. Response 2: It's not a problem, it's the way it's designed and supposed to work. As Paul says, access() has limited usefulness, and in my experience, is often misused. -- Dave Olson, Silicon Graphics Guru and busybody at large So, the folks at SGI think that the test ought to be performed in a manner other than calling access(). I doubt they are going to do anything to change the behaviour of access() so, if the zsh group doesn't change the nature of the test underlying -x, I need a workaround.... Any takers? Colin. -- * CJ Holmes, PhD, * Dept Neurology, UCLA School of Medicine, 4238 Reed Bldg, Box 951769 * 710 Westwood Plaza, Los Angeles, CA 90095-1769 * ph 310-206-2101 fx 310-206-5518 email holmes@loni.ucla.edu