Xref: utzoo comp.unix.programmer:1229 alt.sources.d:1565 Path: utzoo!utgpu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!mindcraft.com!karish From: karish@mindcraft.com (Chuck Karish) Newsgroups: comp.unix.programmer,alt.sources.d Subject: Re: -x implementations Message-ID: <668288533.3106@mindcraft.com> Date: 6 Mar 91 19:42:12 GMT References: <1943:Jan2619:34:3591@kramden.acf.nyu.edu> <2856@charon.cwi.nl> <8869@star.cs.vu.nl> <1991Jan29.153242.12335@convex.com> <8896@star.cs.vu.nl> <19017@rpp386.cactus.org> <6124@segue.segue.com> Organization: Mindcraft, Inc. Lines: 28 In article <6124@segue.segue.com> jim@segue.segue.com (Jim Balter) writes: >In article <19017@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes: >>test(1) is the sick on. Any version of test(1) which relies on >>access(2) is broken. > >1) The fact that access does not provide an option to test the effective uid > is brain damage. access(2) has a very specific purpose. If test(1) uses access(2) to determine whether the current process has access to a particular file, it's misusing access(2). There is no system interface that simply and reliably provides the desired information. The advice of the 1003.1 committee is not to try to guess whether access would be granted based on the permission bits, but to actually try the function or utility and see what happens. This is somewhat unsatisfactory, but so is guessing, which can't possibly take into account the effects of extended ('alternate', 'additional') methods for determining file access (security levels, ACLs, etc.) It would be helpful if there were a second interface that could be used to check file access based on the effective UID. Adding a flag to access() at this point would not be an acceptable solution; it would break too much existing code. Chuck Karish karish@mindcraft.com Mindcraft, Inc. (415) 323-9000