From owner-freebsd-audit Mon Jul 30 10:23: 7 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.chem.msu.ru (mail.chem.msu.ru [195.208.208.19]) by hub.freebsd.org (Postfix) with ESMTP id 982C337B401; Mon, 30 Jul 2001 10:23:03 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su ([158.250.32.97]) by mail.chem.msu.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id NHPRW1G1; Mon, 30 Jul 2001 21:15:07 +0400 Received: (from yar@localhost) by comp.chem.msu.su (8.11.1/8.11.1) id f6UHMvS44905; Mon, 30 Jul 2001 21:22:57 +0400 (MSD) (envelope-from yar) Date: Mon, 30 Jul 2001 21:22:57 +0400 From: Yar Tikhiy To: Mike Barcroft Cc: audit@FreeBSD.ORG Subject: Re: finger(1) & fingerd(8) Message-ID: <20010730212257.C26476@comp.chem.msu.su> References: <20010728155159.A35483@snark.rinet.ru> <20010728144554.C86837@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010728144554.C86837@coffee.q9media.com>; from mike@FreeBSD.ORG on Sat, Jul 28, 2001 at 02:45:54PM -0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jul 28, 2001 at 02:45:54PM -0400, Mike Barcroft wrote: > > [...] > > if (access(buf, F_OK) == 0) > > return 1; > [...] > > I know this isn't your code, but this should also probably use open(2) > as well. First, I must have missed something, but why is access(2) a bad thing at this particular point? Second, open(2) can't be used as a drop-in replacement for access(.., F_OK) here because it can't tell permission errors on a directory from those on a file itself. IMHO stat(2) should be used here if the historical behaviour of finger(1) is to be preserved. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message