]> git.hungrycats.org Git - linux/commitdiff
[PATCH] make create() follow symlinks again
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 7 Jul 2003 09:14:10 +0000 (02:14 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 7 Jul 2003 09:14:10 +0000 (02:14 -0700)
   The intent patches broke behaviour w.r.t. following symlinks when
doing an open() with file creation. The problem occurs in open_namei()
because the LOOKUP_PARENT flag is no longer set when we do the call to
follow_link().

fs/namei.c

index 2fc6f11fe795c56dd54ceec6603d2aa52abe4279..4bd15bdcef47e96c4aca40e81929d358fbed8039 100644 (file)
@@ -1344,6 +1344,7 @@ do_link:
         * stored in nd->last.name and we will have to putname() it when we
         * are done. Procfs-like symlinks just set LAST_BIND.
         */
+       nd->flags |= LOOKUP_PARENT;
        error = security_inode_follow_link(dentry, nd);
        if (error)
                goto exit_dput;
@@ -1352,6 +1353,7 @@ do_link:
        dput(dentry);
        if (error)
                return error;
+       nd->flags &= ~LOOKUP_PARENT;
        if (nd->last_type == LAST_BIND) {
                dentry = nd->dentry;
                goto ok;