]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/namei.c
fix execute checking in permission()
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 17 Oct 2007 06:27:08 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:52 +0000 (08:42 -0700)
commit22590e41cb569add194829c08dc0ceea74b38a65
tree0db73fe0e78bcde816dcf289e0aa5323abf73833
parent043f46f6151df2c518988b5e41376e42491257b5
fix execute checking in permission()

permission() checks that MAY_EXEC is only allowed on regular files if at least
one execute bit is set in the file mode.

generic_permission() already ensures this, so the extra check in permission()
is superfluous.

If the filesystem defines it's own ->permission() the check may still be
needed.  In this case move it after ->permission().  This is needed because
filesystems such as FUSE may need to refresh the inode attributes before
checking permissions.

This check should be moved inside ->permission(), but that's another story.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c