Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!vsi1!daver!lynx!m5 From: m5@lynx.uucp (Mike McNally) Newsgroups: comp.unix.wizards Subject: access() Message-ID: <5691@lynx.UUCP> Date: 5 Jun 89 17:30:15 GMT Reply-To: m5@lynx.UUCP (Mike McNally) Distribution: na Organization: Lynx Real-Time Systems Inc, Campbell CA Lines: 28 Is it appropriate that access("somefile", X_OK) always succeeds (returns 0), whether "somefile" has an "x" bit or not, when called while the eff. user id is root? For the curious, I tested this under 4.3BSD on my Integrated "Solutions" 68020 box with the following program: main(ac, av) int ac; char **av; { printf("%d\n", access(av[1], atoi(av[2]))); } The program is invoked as "t something 1". When run on a particular file while not setuid to root, it prints -1 for a plain text file without any "x" bits. After I setuid to root, the exact same invocation prints 0. Of course, even while setuid, an attempt to execute the file fails with EACCES. Note that I don't want to start another war about the usefulness of access(). -- Mike McNally Lynx Real-Time Systems uucp: {voder,athsys}!lynx!m5 phone: 408 370 2233 Where equal mind and contest equal, go.