Yes if you define an `O_NONE' flag -- i.e. as opposed to O_RDONLY etc.
All the problems with side effects due to open and lack of permissions
are avoided by that: O_NONE means "return me a cookie, don't do anything
else".
The different between stat() and lstat() is also covered nicely by
`O_NOFOLLOW', which we already have.
> a. Is this desireable?
For programs that call stat() on a lot of things, the added
overhead of open/fstat/close is probably significant.
For the rarer things like fchflags() which might arrive, perhaps O_NONE
this is a good idea. It is certainly simpler than the proposals to add
fchflags/chflags/lchflags.
And as you point out, it's possible to improve security this way.
I recommend coding a patch to find out if O_NONE is really as easy as it
seems.
-- Jamie
-
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/