From owner-freebsd-questions Sat Mar 31 6:57:25 2001 Delivered-To: freebsd-questions@freebsd.org Received: from clmboh1-smtp3.columbus.rr.com (clmboh1-smtp3.columbus.rr.com [65.24.0.112]) by hub.freebsd.org (Postfix) with ESMTP id C6AB437B718 for ; Sat, 31 Mar 2001 06:57:22 -0800 (PST) (envelope-from wmoran@iowna.com) Received: from iowna.com (dhcp065-024-023-038.columbus.rr.com [65.24.23.38]) by clmboh1-smtp3.columbus.rr.com (8.11.2/8.11.2) with ESMTP id f2VEsZw01282; Sat, 31 Mar 2001 09:54:35 -0500 (EST) Message-ID: <3AC5EF5A.3CE0FB08@iowna.com> Date: Sat, 31 Mar 2001 09:53:14 -0500 From: Bill Moran X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.3-RC i386) X-Accept-Language: en MIME-Version: 1.0 To: Edwin Groothuis Cc: freebsd-questions@freebsd.org Subject: Re: access() system call References: <3AC5EAFA.C8D4E301@iowna.com> <20010331165151.J490@cgmd76206.chello.nl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Edwin Groothuis wrote: > > On Sat, Mar 31, 2001 at 09:34:34AM -0500, Bill Moran wrote: > > In the man page for the access(2) syscall, it states "access() is a > > potential security hole and should never be used." > > > > I have 3 questions regarding this: > > > > 1. What should I use instead? > > stat(2). It's in the SEE ALSO section of the man-page. I could use stat(2), but it would require multiple lines of code to resolve the coding problem I need to do, whereas access(2) could handle the job in a single line. It's ridiculous, all I want to know is whether the current user has read access to a filesystem object, once user, group and world perms are all taking into account. If that's what I have to do, fine. But I was hoping for a more "drop-in" replacement for access(2). Thanks for the feedback. -Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message