patch-pre2.0.11 linux/fs/ext2/ioctl.c

Next file: linux/fs/locks.c
Previous file: linux/fs/buffer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.10/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c
@@ -37,11 +37,12 @@
 			return err;
 		flags = get_user((int *) arg);
 		/*
-		 * The IMMUTABLE flag can only be changed by the super user
-		 * when the security level is zero.
+		 * The IMMUTABLE and APPEND_ONLY flags can only be changed by
+		 * the super user when the security level is zero.
 		 */
-		if ((flags & EXT2_IMMUTABLE_FL) ^
-		    (inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)) {
+		if ((flags & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) ^
+		    (inode->u.ext2_i.i_flags &
+		     (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) {
 			/* This test looks nicer. Thanks to Pauline Middelink */
 			if (!fsuser() || securelevel > 0)
 				return -EPERM;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this