From 759be208409db44bdc81bd28156c38e4f9501ecd Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Sat, 23 Feb 2008 15:23:27 -0800 Subject: [PATCH] fuse: fix permission checking [upstream commit 1a823ac9ff09cbdf39201df37b7ede1f9395de83] I added a nasty local variable shadowing bug to fuse in 2.6.24, with the result, that the 'default_permissions' mount option is basically ignored. How did this happen? - old err declaration in inner scope - new err getting declared in outer scope - 'return err' from inner scope getting removed - old declaration not being noticed -Wshadow would have saved us, but it doesn't seem practical for the kernel :( More testing would have also saved us :(( Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- fs/fuse/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 80d2f5292cf9..dcac5919e330 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -905,7 +905,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd) } if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { - int err = generic_permission(inode, mask, NULL); + err = generic_permission(inode, mask, NULL); /* If permission is denied, try to refresh file attributes. This is also needed, because the root -- 2.39.5