path: root/fs/autofs4/root.c
diff options
authorZhao Hongjiang <zhaohongjiang@huawei.com>2013-02-20 13:13:55 +1100
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-26 02:46:14 -0500
commit41735818766c0ec215b9a69591e7eae642061954 (patch)
tree564ccbbc05d987f833050573e7fad23ce34dfc89 /fs/autofs4/root.c
parentfs/exec.c: make bprm_mm_init() static (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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4/root.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 3cdf835e8b49..230bd2aad4f4 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -587,7 +587,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
/* This allows root to remove symlinks */
if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN))
- return -EACCES;
+ return -EPERM;
if (atomic_dec_and_test(&ino->count)) {
p_ino = autofs4_dentry_ino(dentry->d_parent);