Commit a35d0e11 authored by Trond Myklebust's avatar Trond Myklebust

[PATCH] make create() follow symlinks again

   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().
parent 62133cb1
...@@ -1344,6 +1344,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) ...@@ -1344,6 +1344,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
* stored in nd->last.name and we will have to putname() it when we * stored in nd->last.name and we will have to putname() it when we
* are done. Procfs-like symlinks just set LAST_BIND. * are done. Procfs-like symlinks just set LAST_BIND.
*/ */
nd->flags |= LOOKUP_PARENT;
error = security_inode_follow_link(dentry, nd); error = security_inode_follow_link(dentry, nd);
if (error) if (error)
goto exit_dput; goto exit_dput;
...@@ -1352,6 +1353,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd) ...@@ -1352,6 +1353,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
dput(dentry); dput(dentry);
if (error) if (error)
return error; return error;
nd->flags &= ~LOOKUP_PARENT;
if (nd->last_type == LAST_BIND) { if (nd->last_type == LAST_BIND) {
dentry = nd->dentry; dentry = nd->dentry;
goto ok; goto ok;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment