aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-07-17 09:37:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-07-26 20:53:22 -0400
commitb77b0646ef4efe31a7449bb3d9360fd00f95433d (patch)
treef8487fe832fbe23400c9f98e808555f0251fb158 /fs/exec.c
parenta110343f0d6d41f68b7cf8c00b57a3172c67f816 (diff)
[PATCH] pass MAY_OPEN to vfs_permission() explicitly
... and get rid of the last "let's deduce mask from nameidata->flags" bit. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c
index b8792a13153..0ba5d355c5a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -118,7 +118,7 @@ asmlinkage long sys_uselib(const char __user * library)
118 if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) 118 if (!S_ISREG(nd.path.dentry->d_inode->i_mode))
119 goto exit; 119 goto exit;
120 120
121 error = vfs_permission(&nd, MAY_READ | MAY_EXEC); 121 error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN);
122 if (error) 122 if (error)
123 goto exit; 123 goto exit;
124 124
@@ -666,7 +666,7 @@ struct file *open_exec(const char *name)
666 struct inode *inode = nd.path.dentry->d_inode; 666 struct inode *inode = nd.path.dentry->d_inode;
667 file = ERR_PTR(-EACCES); 667 file = ERR_PTR(-EACCES);
668 if (S_ISREG(inode->i_mode)) { 668 if (S_ISREG(inode->i_mode)) {
669 int err = vfs_permission(&nd, MAY_EXEC); 669 int err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN);
670 file = ERR_PTR(err); 670 file = ERR_PTR(err);
671 if (!err) { 671 if (!err) {
672 file = nameidata_to_filp(&nd, 672 file = nameidata_to_filp(&nd,