From owner-freebsd-hackers Sat Mar 31 14:22:27 2001 Delivered-To: freebsd-hackers@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 46CC337B718; Sat, 31 Mar 2001 14:22:24 -0800 (PST) (envelope-from wmoran@iowna.com) Received: from iowna.com (dhcp065-024-023-232.columbus.rr.com [65.24.23.232]) by clmboh1-smtp3.columbus.rr.com (8.11.2/8.11.2) with ESMTP id f2VMJcw26387; Sat, 31 Mar 2001 17:19:38 -0500 (EST) Message-ID: <3AC6676D.C5E4771B@iowna.com> Date: Sat, 31 Mar 2001 18:25:33 -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: Mike Smith Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Security problems with access(2)? - off topic References: <200103312158.f2VLwo301522@mass.dis.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mike Smith wrote: > This is actually an interesting case. I have some interesting clients. The reality of the matter is that their filesystem organization on the server is terrible. This could all be solved with a properly reorganized directory hierarchy - and that was my first suggestion when they complained. However, it'll be cheaper for me to tweak Samba than to correct their disorganization, since they have apps that expect things to be in certain places, and users who aren't terribly educated (or cooperative). > The canonical answer is that you're wrong, and you should use stat(2) for > this purpose. That's why I gave the scenerio. > However it's fair to assume that with ACLs entering the picture, > access(2) may actually given you a better answer. I would poke the > TrustedBSD people to be certain about this, though. Another argument in favor of access() is that the fix (for the time being) is: if (!access(n,R_OK) ) continue; Which is about the simplest tweak I've ever made to a program. stat() would not take a lot more work, but being as lazy as I am, I'll use access() now that I know it's safe in this situation. I know nothing of ACLs, so you've just indicated that there's something new I need to learn. I'm also going to have to get up to date with what TrustedBSD is doing, as I haven't been watching them much. Thanks for the feedback, Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message