access system call broken?

Dick Dunn rcd at opus.UUCP
Wed Nov 28 17:41:15 AEST 1984


> In v7 and 4.2, with the possible exception of
> write access, the access system call always returns
> success for the super user. this seems wrong
> to me. whether one is super user or not, if execute bits
> are not set, that's all she wrote. any wisdom as to why
> a call to check execute permission (i.e access(filename, 01))
> should return 0 for a plain file with no execute permissions?

This is even curiouser if you peruse the documentation.  Access(2) claims
that "...it is only access bits that are checked."  However, a file even with
mode 0 is regarded as executable by access.  Exec doesn't think it's
executable (as the author of the parent article indicated) and the
documentation says as much:  "Even for the super-user, at least one of the
execute-permission bits must be set for a file to be executed."  That's a
good thing in a way; it can keep you from doing a few stupid things if
you're wandering around as root with "." in your path (which is a bad idea
for other reasons, however).
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Reality?  Gad, that's worse than puberty!



More information about the Comp.unix.wizards mailing list