From 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 23 Jan 2013 17:07:38 -0500 Subject: new helper: file_inode(file) Signed-off-by: Al Viro --- fs/ncpfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ncpfs/ioctl.c') diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 6958adfaff0..5c1e9262219 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -808,7 +808,7 @@ outrel: long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { - struct inode *inode = filp->f_dentry->d_inode; + struct inode *inode = file_inode(filp); struct ncp_server *server = NCP_SERVER(inode); uid_t uid = current_uid(); int need_drop_write = 0; -- cgit v1.2.3 From 41735818766c0ec215b9a69591e7eae642061954 Mon Sep 17 00:00:00 2001 From: Zhao Hongjiang Date: Wed, 20 Feb 2013 13:13:55 +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 Signed-off-by: Al Viro --- fs/ncpfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ncpfs/ioctl.c') diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 5c1e9262219..811d411418d 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