From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 1 17:48:57 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C458C16A4CE for ; Sat, 1 Nov 2003 17:48:57 -0800 (PST) Received: from mta7.adelphia.net (mta7.adelphia.net [68.168.78.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5C4E43FAF for ; Sat, 1 Nov 2003 17:48:56 -0800 (PST) (envelope-from andi_payn@speedymail.org) Received: from [10.1.0.9] ([68.65.235.109]) by mta13.adelphia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20031102011207.GCHX20181.mta13.adelphia.net@[10.1.0.9]>; Sat, 1 Nov 2003 20:12:07 -0500 From: andi payn To: Terry Lambert In-Reply-To: <3FA42945.A5EA17C1@mindspring.com> References: <1067528798.36829.2128.camel@verdammt.falcotronic.net> <20031031162757.GA56981@walton.maths.tcd.ie> <1067628015.825.64.camel@verdammt.falcotronic.net> <20031031.130229.132929054.imp@bsdimp.com> <3FA42945.A5EA17C1@mindspring.com> Content-Type: text/plain Message-Id: <1067735516.825.492.camel@verdammt.falcotronic.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 01 Nov 2003 17:12:06 -0800 Content-Transfer-Encoding: 7bit cc: dwmalone@maths.tcd.ie cc: freebsd-hackers@freebsd.org Subject: Re: O_NOACCESS? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2003 01:48:57 -0000 On Sat, 2003-11-01 at 13:44, Terry Lambert wrote: > "M. Warner Losh" wrote: > > Rewind units on tape drives? If there's no access check done, and I > > open the rewind unit as joe-smoe? The close code is what does the > > rewind, and you don't have enough knowledge to know if the tape was > > opened r/w there. > > Which brings up the idea of passing fp->fd_flags to VOP_CLOSE()... Looking at the calls to VOP_CLOSE, there's either a flags variable, or the fmode variable I mentioned before, being passed as the second parameter. I haven't checked where this comes from in all cases, but when vn_closefile gets called, the value of this parameter is fp->f_flag. Similarly, when an open cannot be completed, the value is fmode. In other words, it looks like the flags are already there.