From owner-freebsd-hackers Sat Mar 31 10:23:42 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id 8414537B719 for ; Sat, 31 Mar 2001 10:23:39 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 31 Mar 2001 19:23:38 +0100 (BST) Date: Sat, 31 Mar 2001 19:23:38 +0100 From: David Malone To: Warner Losh Cc: Paul Herman , Bill Moran , freebsd-hackers@FreeBSD.ORG Subject: Re: Security problems with access(2)? Message-ID: <20010331192338.A45841@walton.maths.tcd.ie> References: <200103311819.f2VIJOO13998@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103311819.f2VIJOO13998@harmony.village.org>; from imp@harmony.village.org on Sat, Mar 31, 2001 at 11:18:09AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Mar 31, 2001 at 11:18:09AM -0700, Warner Losh wrote: > In message Paul Herman writes: > : Shouldn't the stat(2) manpage then also carry the same warning that > : access(2) has (apparently dating back to 4.4BSD-Lite)? ...or maybe > : even a suggestion to use fstat(2) instead... > > No. stat can be used safely. In fact, it can even be used to detect > when the old switch-er-ooo has taken place on file systems that > conform to the POSIX standard. However, it does take some care to use > it safely. Don't you need fstat to do this? (In which case you may as well just open the file and fstat it anyway). David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message