mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
fs: change return values from -EACCES to -EPERM
According to SUSv3: [EACCES] Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions. [EPERM] Operation not permitted. An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resource. So -EPERM should be returned if capability checks fails. Strictly speaking this is an API change since the error code user sees is altered. Signed-off-by: Zhao Hongjiang <[email protected]> Acked-by: Jan Kara <[email protected]> Acked-by: Steven Whitehouse <[email protected]> Acked-by: Ian Kent <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
9cc64ceaa8
commit
4173581876
6 changed files with 16 additions and 16 deletions
|
|
@ -204,7 +204,7 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||
goto out;
|
||||
case UDF_RELOCATE_BLOCKS:
|
||||
if (!capable(CAP_SYS_ADMIN)) {
|
||||
result = -EACCES;
|
||||
result = -EPERM;
|
||||
goto out;
|
||||
}
|
||||
if (get_user(old_block, (long __user *)arg)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue