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

Next file: linux/fs/ext2/ioctl.c
Previous file: linux/fs/ext/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/fs/ext2/acl.c linux/fs/ext2/acl.c
@@ -28,6 +28,13 @@
 	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))

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