mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e4a53cbabc
commit
e4543eddfd
7 changed files with 31 additions and 15 deletions
|
|
@ -637,7 +637,7 @@ static int mount_is_safe(struct nameidata *nd)
|
|||
if (current->uid != nd->dentry->d_inode->i_uid)
|
||||
return -EPERM;
|
||||
}
|
||||
if (permission(nd->dentry->d_inode, MAY_WRITE, nd))
|
||||
if (vfs_permission(nd, MAY_WRITE))
|
||||
return -EPERM;
|
||||
return 0;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue