Date: 11 Oct 2002 09:39:07 -0700 From: Ricardo Anguiano <anguiano@codesourcery.com> To: Chris BeHanna <behanna@zbzoom.net> Cc: FreeBSD Security <security@FreeBSD.ORG> Subject: Re: access() is a security hole? Message-ID: <m3r8exszf8.fsf@mordack.codesourcery.com> In-Reply-To: <20021011094935.I86274-100000@topperwein.pennasoft.com> References: <20021011094935.I86274-100000@topperwein.pennasoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Chris BeHanna <behanna@zbzoom.net> writes: > On Fri, 11 Oct 2002, Bruce Evans wrote: > > Setuid programs should only use access() to check whether they will > > have permission after they set[ug]id() to the real [ug]id. Non-setuid > > programs mostly don't need such checks. They can just try the operation. > > Perhaps the way to avoid the race is to open the file, lock it, > and *then* call access(), then close the file or proceed based upon > the result. What's wrong with opening the file, then using fstat to check the properties of the file associated with the file descriptor? -- Ricardo Anguiano CodeSourcery, LLC To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m3r8exszf8.fsf>