Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!linus!agate!darkstar!saturn.ucsc.edu!hugo From: hugo@saturn.ucsc.edu (Hugo Calendar) Newsgroups: comp.unix.questions Subject: Re: access() call as a su Keywords: ntp PROGRESS Message-ID: <8928@darkstar.ucsc.edu> Date: 14 Nov 90 07:08:37 GMT References: <1423@nixsin.UUCP> <681@mara.cognet.ucla.edu> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz Lines: 44 In article <681@mara.cognet.ucla.edu> iwelch@agsm.ucla.edu (Ivo Welch) writes: >On Mach, a BSD 4.3 clone with a gcc compiler: > >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. > >Is this a bug on my machine, or am I doing something wrong? > >/ivo welch ivo@next.agsm.ucla.edu I just tried this out on machines running Mach, AIX, AOS and SunOS 4.1, and I get the behavior you describe under all of those operating systems. This must be a bug/inaccuracy in access () since I can't execute a file that's not executable, even as root. I understand that root was once able to execute _any_ file, but that that caused a lot of problems, and this "feature" was removed; and thus root wasn't allowed to execute a file unless it had at lease one of the execute bits set. Perhaps access () was never modified when root lost the ability to execute files w/o an execute bit set. I tried executing a file as root from the c-shell, and through the execl () call, and in both cases root couldn't execute a file unless it had an execute bit set. This means that it's not just the c-shell that won't let you execute non-executable files, but it's the OS itself. I'd recommend using the status () call to determind if you can execute a file. -Hugo --- Hugo Calendar ...!ucbvax!ucscc!spica!hugo CmpEng/Math Undergraduate 215 Weeks Avenue hugo@saturn.ucsc.edu IBM RT AIX/Mach Sys Admin Santa Cruz, CA 95060 hugo@ucscd.bitnet Work Phone (408) 459-3224 USA (408) 425-5479 Above at University of California, Santa Cruz -- Hugo Calendar ...!ucbvax!ucscc!spica!hugo CmpEng/Math Undergraduate 215 Weeks Avenue hugo@saturn.ucsc.edu IBM RT AIX/Mach Sys Admin Santa Cruz, CA 95060 hugo@ucscd.bitnet Work Phone (408) 459-3224 USA (408) 425-5479 Above at University of California, Santa Cruz