patch-2.0.4 linux/fs/open.c

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

diff -u --recursive --new-file v2.0.3/linux/fs/open.c linux/fs/open.c
@@ -184,7 +184,8 @@
 		newattrs.ia_mtime = get_user(&times->modtime);
 		newattrs.ia_valid |= ATTR_ATIME_SET | ATTR_MTIME_SET;
 	} else {
-		if ((error = permission(inode,MAY_WRITE)) != 0) {
+		if (current->fsuid != inode->i_uid &&
+		    (error = permission(inode,MAY_WRITE)) != 0) {
 			iput(inode);
 			return error;
 		}

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