Re: silent semantic changes with reiser4

Christoph Hellwig
2004-08-26T12:46:53Z

On Thu, Aug 26, 2004 at 01:43:59AM -0700, Hans Reiser wrote:
> >Again, O_DIRECTORY was added to solve a real-world race, not just for
> >the sake of it.
> >
> Can you supply more details and we will try to reply concretely? Thanks.

It's really userland programming 101 :)

you need to fstat after open to really check that no one swtiched the
path below you to a fifo or device, O_DIRECTORY gets that directly in
the open call, with the additional benefit of making sure you don't
get any of the sideeffects at all that would happen if you're opening
a device file.

the current reiser4 semantics break that and as soon as you're having a
world-writeable (e.g. /tmp) dir on it and someone is doing an opendir
on it he's lost.