mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
path_init(): don't bother with checking MAY_EXEC for LOOKUP_ROOT
we'll hit that check in link_path_walk() anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
159b095628
commit
93893862fb
1 changed files with 2 additions and 8 deletions
10
fs/namei.c
10
fs/namei.c
|
@ -2142,7 +2142,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
|
|||
|
||||
static const char *path_init(struct nameidata *nd, unsigned flags)
|
||||
{
|
||||
int retval = 0;
|
||||
const char *s = nd->name->name;
|
||||
|
||||
if (!*s)
|
||||
|
@ -2154,13 +2153,8 @@ static const char *path_init(struct nameidata *nd, unsigned flags)
|
|||
if (flags & LOOKUP_ROOT) {
|
||||
struct dentry *root = nd->root.dentry;
|
||||
struct inode *inode = root->d_inode;
|
||||
if (*s) {
|
||||
if (!d_can_lookup(root))
|
||||
return ERR_PTR(-ENOTDIR);
|
||||
retval = inode_permission(inode, MAY_EXEC);
|
||||
if (retval)
|
||||
return ERR_PTR(retval);
|
||||
}
|
||||
if (*s && unlikely(!d_can_lookup(root)))
|
||||
return ERR_PTR(-ENOTDIR);
|
||||
nd->path = nd->root;
|
||||
nd->inode = inode;
|
||||
if (flags & LOOKUP_RCU) {
|
||||
|
|
Loading…
Reference in a new issue