O_NOACCESS?

andi payn andi_payn at speedymail.org
Sat Nov 1 17:48:57 PST 2003


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.




More information about the freebsd-hackers mailing list