patch-2.1.112 linux/mm/mmap.c
Next file: linux/mm/simp.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index
-  Lines: 15
-  Date:
Sun Jul 26 13:51:42 1998
-  Orig file: 
v2.1.111/linux/mm/mmap.c
-  Orig date: 
Sun Jul 26 11:57:20 1998
diff -u --recursive --new-file v2.1.111/linux/mm/mmap.c linux/mm/mmap.c
@@ -196,9 +196,14 @@
 			if ((prot & PROT_WRITE) && !(file->f_mode & 2))
 				return -EACCES;
 
+			/* Make sure we don't allow writing to an append-only file.. */
+			if (IS_APPEND(file->f_dentry->d_inode) && (file->f_mode & 2))
+				return -EACCES;
+
 			/* make sure there are no mandatory locks on the file. */
 			if (locks_verify_locked(file->f_dentry->d_inode))
 				return -EAGAIN;
+
 			/* fall through */
 		case MAP_PRIVATE:
 			if (!(file->f_mode & 1))
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov