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:
Zhao Hongjiang 2013-02-20 13:13:55 +11:00 • committed by Al Viro
commit 4173581876
6 changed files with 16 additions and 16 deletions

View file

@ -158,7 +158,7 @@ static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field,
unsigned int x;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return -EPERM;
x = simple_strtoul(buf, NULL, 0);