Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.unix.questions Subject: Re: access() call as a su Keywords: ntp PROGRESS Message-ID: <1990Nov14.082556.17480@Think.COM> Date: 14 Nov 90 08:25:56 GMT References: <1423@nixsin.UUCP> <681@mara.cognet.ucla.edu> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 19 In article <681@mara.cognet.ucla.edu> iwelch@agsm.ucla.edu (Ivo Welch) writes: >I am trying to establish if a file has the executable attribute set. access() >works just fine if I am not the su, or if I su name. However, if I just su, >(i.e. become root), all files appear to access() to be executable. Unix files don't have an "executable attribute". The protection mode includes execute permission bits, though. The superuser implicitly has permission to do whatever it wants (i.e. it ignores the protection modes of files -- that's one of the things that makes it "super"), including executing files that it doesn't have execute access to according to the mode. The access() call determines whether the user (identified by the process's real-userid and real-groupid) has permission to perform the specified operations, so access() is behaving properly. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar