aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-09-29 04:59:35 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:08 -0400
commit650a898342b3fa21c392c06a2b7010fa19823efa (patch)
treee5fc9b3c9590ac82b49755535e1de5e56d2dd6e8 /fs
parent5b35e8e58a315b16d123e2bc080fcc9981501ac4 (diff)
[PATCH] vfs: define new lookup flag for chdir
In the "operation does permission checking" model used by fuse, chdir permission is not checked, since there's no chdir method. For this case set a lookup flag, which will be passed to ->permission(), so fuse can distinguish it from permission checks for other operations. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fuse/dir.c2
-rw-r--r--fs/open.c3
2 files changed, 3 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 }
diff --git a/fs/open.c b/fs/open.c
index 303f06d2a7b9..1574d8fe4909 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -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