summaryrefslogtreecommitdiff
path: root/fs/ncpfs
diff options
context:
space:
mode:
authorZhao Hongjiang <zhaohongjiang@huawei.com>2013-02-07 12:26:07 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2013-02-14 15:25:06 +1100
commitf85873189c59cf44c776311024e5c0ffed40fecb (patch)
tree93d0735547a34416643724c4984ebce20a7add0b /fs/ncpfs
parent3e8954c3b5d2f0ce3e5d95950eeb46d65bbbd5d2 (diff)
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 <zhaohongjiang@huawei.com> Acked-by: Jan Kara <jack@suse.cz> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Ian Kent <raven@themaw.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/ncpfs')
-rw-r--r--fs/ncpfs/ioctl.c2
1 files changed, 1 insertions, 1 deletions
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;