patch-2.1.100 linux/fs/ext2/ioctl.c

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

diff -u --recursive --new-file v2.1.99/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c
@@ -39,10 +39,11 @@
 		    (inode->u.ext2_i.i_flags &
 		     (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) {
 			/* This test looks nicer. Thanks to Pauline Middelink */
-			if (!fsuser())
+			if (!capable(CAP_LINUX_IMMUTABLE))
 				return -EPERM;
 		} else
-			if ((current->fsuid != inode->i_uid) && !fsuser())
+			if ((current->fsuid != inode->i_uid) && 
+			    !capable(CAP_FOWNER))
 				return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
@@ -70,7 +71,7 @@
 	case EXT2_IOC_GETVERSION:
 		return put_user(inode->u.ext2_i.i_version, (int *) arg);
 	case EXT2_IOC_SETVERSION:
-		if ((current->fsuid != inode->i_uid) && !fsuser())
+		if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;

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