diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-17 09:37:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:22 -0400 |
commit | b77b0646ef4efe31a7449bb3d9360fd00f95433d (patch) | |
tree | f8487fe832fbe23400c9f98e808555f0251fb158 /fs/exec.c | |
parent | a110343f0d6d41f68b7cf8c00b57a3172c67f816 (diff) | |
download | linux-b77b0646ef4efe31a7449bb3d9360fd00f95433d.tar.gz linux-b77b0646ef4efe31a7449bb3d9360fd00f95433d.tar.bz2 linux-b77b0646ef4efe31a7449bb3d9360fd00f95433d.zip |
[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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c index b8792a131533..0ba5d355c5a1 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -118,7 +118,7 @@ asmlinkage long sys_uselib(const char __user * library) if (!S_ISREG(nd.path.dentry->d_inode->i_mode)) goto exit; - error = vfs_permission(&nd, MAY_READ | MAY_EXEC); + error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN); if (error) goto exit; @@ -666,7 +666,7 @@ struct file *open_exec(const char *name) struct inode *inode = nd.path.dentry->d_inode; file = ERR_PTR(-EACCES); if (S_ISREG(inode->i_mode)) { - int err = vfs_permission(&nd, MAY_EXEC); + int err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN); file = ERR_PTR(err); if (!err) { file = nameidata_to_filp(&nd, |