Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185922
b: refs/heads/master
c: a2c36b4
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 5, 2010
1 parent 31fe39a commit 78c95e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 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: c99658fe970f442199733bcace1a00b087336a0d
refs/heads/master: a2c36b450ee68470836cb858c58a6ba3a52c5ec5
21 changes: 7 additions & 14 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,

*is_link = 0;

error = -EISDIR;
if (nd->last_type != LAST_NORM || nd->last.name[nd->last.len])
goto exit;

mutex_lock(&dir->d_inode->i_mutex);

path->dentry = lookup_hash(nd);
Expand Down Expand Up @@ -1826,13 +1830,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
audit_inode(pathname, nd.path.dentry);

/*
* We have the parent and last component. First of all, check
* that we are not asked to creat(2) an obvious directory - that
* will not do.
* We have the parent and last component.
*/
error = -EISDIR;
if (nd.last_type != LAST_NORM || nd.last.name[nd.last.len])
goto exit_parent;

error = -ENFILE;
filp = get_empty_filp();
Expand Down Expand Up @@ -1908,16 +1907,10 @@ struct file *do_filp_open(int dfd, const char *pathname,
nd.flags &= ~LOOKUP_PARENT;
if (nd.last_type == LAST_BIND)
goto ok;
error = -EISDIR;
if (nd.last_type != LAST_NORM)
goto exit;
if (nd.last.name[nd.last.len]) {
__putname(nd.last.name);
goto exit;
}
filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode,
pathname, &is_link);
__putname(nd.last.name);
if (nd.last_type == LAST_NORM)
__putname(nd.last.name);
if (is_link)
goto do_link;
if (nd.root.mnt)
Expand Down

0 comments on commit 78c95e4

Please sign in to comment.