Path: utzoo!mnetor!uunet!vsi!friedl From: friedl@vsi.UUCP (Stephen J. Friedl) Newsgroups: comp.lang.c Subject: Re: [braindamaged?] use of access(2) Message-ID: <513@vsi.UUCP> Date: 9 Apr 88 03:26:28 GMT References: <59@vsi.UUCP> <1056@stratus.UUCP> <70@vsi.UUCP> <305@wsccs.UUCP> <7591@ncoast.UUCP> Distribution: comp Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 17 In article <7591@ncoast.UUCP>, allbery@ncoast.UUCP (Brandon Allbery) writes: < As quoted from <368@wsccs.UUCP> by terry@wsccs.UUCP (terry): < | I write: < | > The difficulty is because the shell probably uses access(2) to see if < | > /usr/acct/bin/report is executable < | < | It does. Isn't that what it's supposed to do? < < sh uses access()? Since the real and effective u/gids are not < affected by an exec(), access() is the *wrong* function to use. SVR2 and SVR3 shells do indeed use access(2) incorrectly. MORAL: If you just want to know if a file exists, please use stat(), not access(2). -- Steve Friedl V-Systems, Inc. "Yes, I'm jeff@unh's brother" friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl