Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19811
b: refs/heads/master
c: 170aa3d
h: refs/heads/master
i:
  19809: c8f1a51
  19807: d5d4516
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Feb 5, 2006
1 parent 27a739d commit 8c39eab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f55eab822b93864ef4eef3bd7eadac2a727c914b
refs/heads/master: 170aa3d02614ae621d54af10555e2f48977ae8de
32 changes: 16 additions & 16 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,8 @@ static int fastcall do_path_lookup(int dfd, const char *name,
unsigned int flags, struct nameidata *nd)
{
int retval = 0;
int fput_needed;
struct file *file;

nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
Expand All @@ -1091,29 +1093,22 @@ static int fastcall do_path_lookup(int dfd, const char *name,
nd->mnt = mntget(current->fs->pwdmnt);
nd->dentry = dget(current->fs->pwd);
} else {
struct file *file;
int fput_needed;
struct dentry *dentry;

file = fget_light(dfd, &fput_needed);
if (!file) {
retval = -EBADF;
goto out_fail;
}
retval = -EBADF;
if (!file)
goto unlock_fail;

dentry = file->f_dentry;

if (!S_ISDIR(dentry->d_inode->i_mode)) {
retval = -ENOTDIR;
fput_light(file, fput_needed);
goto out_fail;
}
retval = -ENOTDIR;
if (!S_ISDIR(dentry->d_inode->i_mode))
goto fput_unlock_fail;

retval = file_permission(file, MAY_EXEC);
if (retval) {
fput_light(file, fput_needed);
goto out_fail;
}
if (retval)
goto fput_unlock_fail;

nd->mnt = mntget(file->f_vfsmnt);
nd->dentry = dget(dentry);
Expand All @@ -1127,7 +1122,12 @@ static int fastcall do_path_lookup(int dfd, const char *name,
if (unlikely(current->audit_context
&& nd && nd->dentry && nd->dentry->d_inode))
audit_inode(name, nd->dentry->d_inode, flags);
out_fail:
return retval;

fput_unlock_fail:
fput_light(file, fput_needed);
unlock_fail:
read_unlock(&current->fs->lock);
return retval;
}

Expand Down

0 comments on commit 8c39eab

Please sign in to comment.