mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
[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>
This commit is contained in:
parent
a110343f0d
commit
b77b0646ef
7 changed files with 15 additions and 24 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue