diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-08 21:35:04 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 07:55:58 -0800 |
commit | e4543eddfd3bf3e0d625841377fa695a519edfd4 (patch) | |
tree | b62546cb0038529bd8cd583333c556ad799f2081 /fs/exec.c | |
parent | e4a53cbabc81f04e24a5570b4aa6a6384bdbfc67 (diff) | |
download | op-kernel-dev-e4543eddfd3bf3e0d625841377fa695a519edfd4.zip op-kernel-dev-e4543eddfd3bf3e0d625841377fa695a519edfd4.tar.gz |
[PATCH] add a vfs_permission helper
Most permission() calls have a struct nameidata * available. This helper
takes that as an argument and thus makes sure we pass it down for lookup
intents and prepares for per-mount read-only support where we need a struct
vfsmount for checking whether a file is writeable.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -135,7 +135,7 @@ asmlinkage long sys_uselib(const char __user * library) if (!S_ISREG(nd.dentry->d_inode->i_mode)) goto exit; - error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC, &nd); + error = vfs_permission(&nd, MAY_READ | MAY_EXEC); if (error) goto exit; @@ -495,7 +495,7 @@ struct file *open_exec(const char *name) file = ERR_PTR(-EACCES); if (!(nd.mnt->mnt_flags & MNT_NOEXEC) && S_ISREG(inode->i_mode)) { - int err = permission(inode, MAY_EXEC, &nd); + int err = vfs_permission(&nd, MAY_EXEC); if (!err && !(inode->i_mode & 0111)) err = -EACCES; file = ERR_PTR(err); |