Re: [BUG] Kernel 2.4.0-test1-ac10 changes open of symlink behavior.

From: Alexander Viro (viro@math.psu.edu)
Date: Sun Jun 11 2000 - 14:53:25 EST


On Sun, 11 Jun 2000, Andries Brouwer wrote:

> On Sun, Jun 11, 2000 at 01:41:02PM +1000, Daniel Pittman wrote:
>
> > open("/home/daniel/.gnus.el", O_WRONLY|O_CREAT|O_TRUNC, 0666).
> >
> > The .gnus.el file is a symlink to another file on the local disk (same
> > filesystem, even). The result of this call under 2.2.15 is success,
> > 2.4.0 returns -ENOENT.
> >
> > Now, at the point the open call is issued, '.gnus.el' is a symlink to a
> > non-existing file. I think, however, that the O_CREAT should cause it to
> > be created, yes?
>
> Yes. The new POSIX draft standard says
> "In general the open() function follows the symbolic link
> if path names a symbolic link."
> (The exception is the case O_CREAT|O_EXCL.)

Excuse me, but I'll take difference from POSIX over a bunch of very real
races, thank you very much. Again, feel free to propose race-free
implementation if you want that thing back. Until then O_CREAT without
O_EXCL will return -ENOENT on broken symlinks. Userland should not rely
on objects' creation/removal following symlinks. Period.

-
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/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:23 EST