projects/linux·commit a969fd5a

VFS: Remove redundant open-coded mode bit checks in open_exec().

a969fd5a · Trond Myklebust <[email protected]> · 2006-08-22 20:06:04 -04:00

The check in open_exec() for inode->i_mode & 0111 has been made
redundant by the fix to permission().

Signed-off-by: Trond Myklebust <[email protected]>
(cherry picked from 1d3741c5d991686699f100b65b9956f7ee7ae0ae commit)
Commit
a969fd5a4e162c4485ae8f3e49d674656a18fa36
Parents
9167b0b9

Changes

1 files changed · +0 −2

FileStatusAddDelContent
fs/exec.cmodified+0−2View file

fs/exec.c

View file
diff --git a/fs/exec.c b/fs/exec.c
index a6f64a9..f7aabfe 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -486,8 +486,6 @@ struct file *open_exec(const char *name)
if (!(nd.mnt->mnt_flags & MNT_NOEXEC) &&
S_ISREG(inode->i_mode)) {
int err = vfs_permission(&nd, MAY_EXEC);
- if (!err && !(inode->i_mode & 0111))
- err = -EACCES;
file = ERR_PTR(err);
if (!err) {
file = nameidata_to_filp(&nd, O_RDONLY);