Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234288
b: refs/heads/master
c: 11a7b37
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Al Viro committed Mar 15, 2011
1 parent cc5eaf9 commit 19df5f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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: 326be7b484843988afe57566b627fb7a70beac56
refs/heads/master: 11a7b371b64ef39fc5fb1b6f2218eef7c4d035e3
20 changes: 16 additions & 4 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2945,15 +2945,27 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
struct dentry *new_dentry;
struct nameidata nd;
struct path old_path;
int how = 0;
int error;
char *to;

if ((flags & ~AT_SYMLINK_FOLLOW) != 0)
if ((flags & ~(AT_SYMLINK_FOLLOW | AT_EMPTY_PATH)) != 0)
return -EINVAL;
/*
* To use null names we require CAP_DAC_READ_SEARCH
* This ensures that not everyone will be able to create
* handlink using the passed filedescriptor.
*/
if (flags & AT_EMPTY_PATH) {
if (!capable(CAP_DAC_READ_SEARCH))
return -ENOENT;
how = LOOKUP_EMPTY;
}

if (flags & AT_SYMLINK_FOLLOW)
how |= LOOKUP_FOLLOW;

error = user_path_at(olddfd, oldname,
flags & AT_SYMLINK_FOLLOW ? LOOKUP_FOLLOW : 0,
&old_path);
error = user_path_at(olddfd, oldname, how, &old_path);
if (error)
return error;

Expand Down

0 comments on commit 19df5f5

Please sign in to comment.