summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-06 15:58:18 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-10 22:20:18 -0400
commitfec2fa24e84a75447341a20d36e808c8d913a81a (patch)
tree326d81be05554af37e110cc676ef95bc81d6b490 /fs/namei.c
parentcd179f4468acfda2b7e9e236dc37bba815996421 (diff)
downloadlwn-fec2fa24e84a75447341a20d36e808c8d913a81a.tar.gz
lwn-fec2fa24e84a75447341a20d36e808c8d913a81a.zip
may_follow_link(): trim arguments
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 05efcc0fc4b6..82cb1bc9a1bf 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -765,7 +765,6 @@ int sysctl_protected_hardlinks __read_mostly = 0;
/**
* may_follow_link - Check symlink following for unsafe situations
- * @link: The path of the symlink
* @nd: nameidata pathwalk data
*
* In the case of the sysctl_protected_symlinks sysctl being enabled,
@@ -779,7 +778,7 @@ int sysctl_protected_hardlinks __read_mostly = 0;
*
* Returns 0 if following the symlink is allowed, -ve on error.
*/
-static inline int may_follow_link(struct path *link, struct nameidata *nd)
+static inline int may_follow_link(struct nameidata *nd)
{
const struct inode *inode;
const struct inode *parent;
@@ -788,7 +787,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
return 0;
/* Allowed if owner and follower match. */
- inode = link->dentry->d_inode;
+ inode = nd->link.dentry->d_inode;
if (uid_eq(current_cred()->fsuid, inode->i_uid))
return 0;
@@ -801,8 +800,8 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
if (uid_eq(parent->i_uid, inode->i_uid))
return 0;
- audit_log_link_denied("follow_link", link);
- path_put(link);
+ audit_log_link_denied("follow_link", &nd->link);
+ path_put(&nd->link);
path_put(&nd->path);
return -EACCES;
}
@@ -1985,7 +1984,7 @@ static void path_cleanup(struct nameidata *nd)
static int trailing_symlink(struct nameidata *nd)
{
const char *s;
- int error = may_follow_link(&nd->link, nd);
+ int error = may_follow_link(nd);
if (unlikely(error))
return error;
nd->flags |= LOOKUP_PARENT;