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

Next file: linux/fs/ext2/dir.c
Previous file: linux/drivers/video/tgafb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.32/linux/fs/ext2/acl.c linux/fs/ext2/acl.c
@@ -15,46 +15,3 @@
  * This file will contain the Access Control Lists management for the
  * second extended file system.
  */
-
-
-/*
- * ext2_permission ()
- *
- * Check for access rights
- */
-int ext2_permission (struct inode * inode, int mask)
-{
-	unsigned short mode = inode->i_mode;
-
-	/*
-	 * Nobody gets write access to a file on a readonly-fs
-	 */
-	if ((mask & S_IWOTH) && 
-            (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) &&
-            IS_RDONLY(inode))
-		return -EROFS;
-	/*
-	 * Nobody gets write access to an immutable file
-	 */
-	if ((mask & S_IWOTH) && IS_IMMUTABLE(inode))
-		return -EACCES;
-
-	/*
-	 * If no ACL, checks using the file mode
-	 */
-	else if (current->fsuid == inode->i_uid)
-		mode >>= 6;
-	else if (in_group_p (inode->i_gid))
-		mode >>= 3;
-	/*
-	 * Access is always granted for root. We now check last,
-         * though, for BSD process accounting correctness
-	 */
-	if (((mode & mask & S_IRWXO) == mask) || capable(CAP_DAC_OVERRIDE))
-		return 0;
-	if ((mask == S_IROTH) ||
-	    (S_ISDIR(mode)  && !(mask & ~(S_IROTH | S_IXOTH))))
-		if (capable(CAP_DAC_READ_SEARCH))
-			return 0;
-	return -EACCES;
-}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)