From f85873189c59cf44c776311024e5c0ffed40fecb Mon Sep 17 00:00:00 2001 From: Zhao Hongjiang Date: Thu, 7 Feb 2013 12:26:07 +1100 Subject: 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 Acked-by: Jan Kara Acked-by: Steven Whitehouse Acked-by: Ian Kent Cc: Al Viro Signed-off-by: Andrew Morton --- fs/ncpfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ncpfs') diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 6958adfaff08..24a05ba3de26 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -819,7 +819,7 @@ long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) case NCP_IOC_CONN_LOGGED_IN: case NCP_IOC_SETROOT: if (!capable(CAP_SYS_ADMIN)) { - ret = -EACCES; + ret = -EPERM; goto out; } break; -- cgit v1.2.3