diff options
-rw-r--r-- | fs/fuse/dir.c | 2 | ||||
-rw-r--r-- | fs/open.c | 3 | ||||
-rw-r--r-- | include/linux/namei.h | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 409ce6a7cca4..f85b2a282f13 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -776,7 +776,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd) | |||
776 | if ((mask & MAY_EXEC) && !S_ISDIR(mode) && !(mode & S_IXUGO)) | 776 | if ((mask & MAY_EXEC) && !S_ISDIR(mode) && !(mode & S_IXUGO)) |
777 | return -EACCES; | 777 | return -EACCES; |
778 | 778 | ||
779 | if (nd && (nd->flags & LOOKUP_ACCESS)) | 779 | if (nd && (nd->flags & (LOOKUP_ACCESS | LOOKUP_CHDIR))) |
780 | return fuse_access(inode, mask); | 780 | return fuse_access(inode, mask); |
781 | return 0; | 781 | return 0; |
782 | } | 782 | } |
@@ -546,7 +546,8 @@ asmlinkage long sys_chdir(const char __user * filename) | |||
546 | struct nameidata nd; | 546 | struct nameidata nd; |
547 | int error; | 547 | int error; |
548 | 548 | ||
549 | error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd); | 549 | error = __user_walk(filename, |
550 | LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd); | ||
550 | if (error) | 551 | if (error) |
551 | goto out; | 552 | goto out; |
552 | 553 | ||
diff --git a/include/linux/namei.h b/include/linux/namei.h index 45511a5918d3..c6470ba00668 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -54,6 +54,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
54 | #define LOOKUP_OPEN (0x0100) | 54 | #define LOOKUP_OPEN (0x0100) |
55 | #define LOOKUP_CREATE (0x0200) | 55 | #define LOOKUP_CREATE (0x0200) |
56 | #define LOOKUP_ACCESS (0x0400) | 56 | #define LOOKUP_ACCESS (0x0400) |
57 | #define LOOKUP_CHDIR (0x0800) | ||
57 | 58 | ||
58 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); | 59 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); |
59 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); | 60 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); |