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

From: Andries Brouwer (aeb@veritas.com)
Date: Sun Jun 11 2000 - 14:38:25 EST


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.)

Thus the open_namei() code and the earlier comment
-------------------------------------------------------------------------
/* [Feb-Apr 2000 AV] Complete rewrite. Rules for symlinks:
 * inside the path - always follow.
 * in the last component in creation/removal/renaming - never follow.
 * if LOOKUP_FOLLOW passed - follow.
 * if the pathname has trailing slashes - follow.
 * otherwise - don't follow.
 * (applied in that order).
 */
-------------------------------------------------------------------------
have to be adapted a little.

Andries

-
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