lkml.org 
[lkml]   [2000]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateThu, 23 Mar 2000 18:14:46 -0800
FromMitchell Blank Jr <>
SubjectRe: fcntl(2) and other file systems like XFS
Jamie Lokier wrote:
> On a file with permission 400 or 200 or 000:
>
> open("f", 0x4) = -1 EACCES (Permission denied)
>
> Oh dear, you need to read _and_ write permission to open this file with
> mode O_NONE. And then you can't read or write it :-)

Yes, that's very important. There was a long-standing security bug in
*BSD's where you could open("/dev/whatever", 0) with no permission on
the inode and then do ioctl()s at it. Under linux, you're only allowed
to create these special file handles if you have complete permission to
open the file. It's counter-intuitive, but correct.

-Mitch

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2010