Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fuse: fix permission checking

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 <mszeredi@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Miklos Szeredi and committed by
Linus Torvalds
1a823ac9 fddd9cf8

+1 -1
+1 -1
fs/fuse/dir.c
··· 906 906 } 907 907 908 908 if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { 909 - int err = generic_permission(inode, mask, NULL); 909 + err = generic_permission(inode, mask, NULL); 910 910 911 911 /* If permission is denied, try to refresh file 912 912 attributes. This is also needed, because the root