patch-2.1.75 linux/fs/ext2/acl.c

Next file: linux/fs/ext2/balloc.c
Previous file: linux/fs/coda/upcall.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.74/linux/fs/ext2/acl.c linux/fs/ext2/acl.c
@@ -39,11 +39,7 @@
 	 */
 	if ((mask & S_IWOTH) && IS_IMMUTABLE(inode))
 		return -EACCES;
-	/*
-	 * Special case, access is always granted for root
-	 */
-	if (fsuser())
-		return 0;
+
 	/*
 	 * If no ACL, checks using the file mode
 	 */
@@ -51,7 +47,11 @@
 		mode >>= 6;
 	else if (in_group_p (inode->i_gid))
 		mode >>= 3;
-	if (((mode & mask & S_IRWXO) == mask))
+	/*
+	 * Access is always granted for root. We now check last,
+         * though, for BSD process accounting correctness
+	 */
+	if (((mode & mask & S_IRWXO) == mask) || fsuser())
 		return 0;
 	else
 		return -EACCES;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov