Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!mcnc!xanth!john From: john@xanth.UUCP Newsgroups: comp.unix.questions Subject: Re: access(2) question Message-ID: <1341@xanth.UUCP> Date: Thu, 18-Jun-87 19:58:00 EDT Article-I.D.: xanth.1341 Posted: Thu Jun 18 19:58:00 1987 Date-Received: Sat, 20-Jun-87 01:28:43 EDT References: <530@applix.UUCP> Organization: Old Dominion University, Norfolk Va. Lines: 22 Keywords: access permissions In article <530@applix.UUCP>, mark@applix.UUCP (Mark Fox) writes: > Does anybody know why access checks file accessibility using the real [ug]id > in place of the effective [ug]id? It seems to me that access should agree > with open(2) as far as whether a program has write or read access to a file. > Inside a set-uid program that assumption obviously doesn't work while > uid != euid. Well, the reason that access was added was to make it possible for a set[ug]id program to be able to discern whether or not the real user running it would have access to a certain file. > Is there a better way of implementing eaccess than using open/close, assuming > I don't have the file already opened? Not really. It doesn't even change the access or update times until you do a read or write, respectively, so as long as you don't open O_TRUNC or O_CREAT, you'll be ok. -- John Owens Old Dominion University - Norfolk, Virginia, USA john@ODU.EDU old arpa: john%odu.edu@RELAY.CS.NET +1 804 440 4529 old uucp: {seismo,harvard,sun,hoptoad}!xanth!john