patch-2.1.56 linux/fs/namei.c

Next file: linux/fs/ncpfs/file.c
Previous file: linux/fs/minix/fsync.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.55/linux/fs/namei.c linux/fs/namei.c
@@ -593,8 +593,12 @@
 	 * An append-only file must be opened in append mode for writing.
 	 */
 	error = -EPERM;
-	if (IS_APPEND(inode) && ((flag & FMODE_WRITE) && !(flag & O_APPEND)))
-		goto exit;
+	if (IS_APPEND(inode)) {
+		if  ((flag & FMODE_WRITE) && !(flag & O_APPEND))
+			goto exit;
+		if (flag & O_TRUNC)
+			goto exit;
+	}
 
 	if (flag & O_TRUNC) {
 		error = get_write_access(inode);

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