summaryrefslogtreecommitdiffstats
path: root/fs/ext2/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/acl.c')
-rw-r--r--fs/ext2/acl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 91ef7c8cc..0b2701fe6 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -1,9 +1,10 @@
/*
* linux/fs/ext2/acl.c
*
- * Copyright (C) 1993, 1994 Remy Card (card@masi.ibp.fr)
- * Laboratoire MASI - Institut Blaise Pascal
- * Universite Pierre et Marie Curie (Paris VI)
+ * Copyright (C) 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
*/
/*
@@ -30,12 +31,12 @@ int ext2_permission (struct inode * inode, int mask)
* Nobody gets write access to an immutable file
*/
if ((mask & S_IWOTH) && IS_IMMUTABLE(inode))
- return 0;
+ return -EACCES;
/*
* Special case, access is always granted for root
*/
if (fsuser())
- return 1;
+ return 0;
/*
* If no ACL, checks using the file mode
*/
@@ -44,7 +45,7 @@ int ext2_permission (struct inode * inode, int mask)
else if (in_group_p (inode->i_gid))
mode >>= 3;
if (((mode & mask & S_IRWXO) == mask))
- return 1;
- else
return 0;
+ else
+ return -EACCES;
}