kill file_permission() completely
convert the last remaining caller to inode_permission() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Родитель
1b5d783c94
Коммит
3bfa784a65
18
fs/namei.c
18
fs/namei.c
|
@ -303,23 +303,6 @@ int inode_permission(struct inode *inode, int mask)
|
||||||
return security_inode_permission(inode, mask);
|
return security_inode_permission(inode, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* file_permission - check for additional access rights to a given file
|
|
||||||
* @file: file to check access rights for
|
|
||||||
* @mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC)
|
|
||||||
*
|
|
||||||
* Used to check for read/write/execute permissions on an already opened
|
|
||||||
* file.
|
|
||||||
*
|
|
||||||
* Note:
|
|
||||||
* Do not use this function in new code. All access checks should
|
|
||||||
* be done using inode_permission().
|
|
||||||
*/
|
|
||||||
int file_permission(struct file *file, int mask)
|
|
||||||
{
|
|
||||||
return inode_permission(file->f_path.dentry->d_inode, mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_write_access() gets write permission for a file.
|
* get_write_access() gets write permission for a file.
|
||||||
* put_write_access() releases this write permission.
|
* put_write_access() releases this write permission.
|
||||||
|
@ -3405,7 +3388,6 @@ EXPORT_SYMBOL(kern_path_parent);
|
||||||
EXPORT_SYMBOL(kern_path);
|
EXPORT_SYMBOL(kern_path);
|
||||||
EXPORT_SYMBOL(vfs_path_lookup);
|
EXPORT_SYMBOL(vfs_path_lookup);
|
||||||
EXPORT_SYMBOL(inode_permission);
|
EXPORT_SYMBOL(inode_permission);
|
||||||
EXPORT_SYMBOL(file_permission);
|
|
||||||
EXPORT_SYMBOL(unlock_rename);
|
EXPORT_SYMBOL(unlock_rename);
|
||||||
EXPORT_SYMBOL(vfs_create);
|
EXPORT_SYMBOL(vfs_create);
|
||||||
EXPORT_SYMBOL(vfs_follow_link);
|
EXPORT_SYMBOL(vfs_follow_link);
|
||||||
|
|
|
@ -1490,7 +1490,6 @@ extern void dentry_unhash(struct dentry *dentry);
|
||||||
/*
|
/*
|
||||||
* VFS file helper functions.
|
* VFS file helper functions.
|
||||||
*/
|
*/
|
||||||
extern int file_permission(struct file *, int);
|
|
||||||
extern void inode_init_owner(struct inode *inode, const struct inode *dir,
|
extern void inode_init_owner(struct inode *inode, const struct inode *dir,
|
||||||
mode_t mode);
|
mode_t mode);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -3542,7 +3542,8 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the process need read permission on control file */
|
/* the process need read permission on control file */
|
||||||
ret = file_permission(cfile, MAY_READ);
|
/* AV: shouldn't we check that it's been opened for read instead? */
|
||||||
|
ret = inode_permission(cfile->f_path.dentry->d_inode, MAY_READ);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче