Subject: Re: Addition to force open to open only regular files
To: Nathan J. Williams <nathanw@MIT.EDU>
From: Greywolf <>
List: tech-kern
Date: 11/10/2000 17:52:14
On 10 Nov 2000, Nathan J. Williams wrote:

# > So here are patches which add a new open flag, O_REG_FILE, and add a test
# > to the kernel after we've done the name lookup but before we've done the
# > VOP_OPEN() to make sure we really got a regular file.
# > 
# > Thoughts?
# ``Yuck''.


If you're concerned about the type of file you're opening, OPEN the thing
and then fstat(fd) it.  If it's not the right type, act appropriately,
whether that means looping on trying to open something (based on user
input) or abort and bitch.

It is not (always) the responsibility of the OS to solve the programmer's
security issues.

*BSD: Multi-platform OS