patch-2.1.75 linux/fs/attr.c

Next file: linux/fs/binfmt_elf.c
Previous file: linux/fs/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.74/linux/fs/attr.c linux/fs/attr.c
@@ -41,8 +41,8 @@
 		if ((current->fsuid != inode->i_uid) && !fsuser())
 			goto error;
 		/* Also check the setgid bit! */
-		if (!fsuser() && !in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :
-					     inode->i_gid))
+		if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :
+				inode->i_gid) && !fsuser())
 			attr->ia_mode &= ~S_ISGID;
 	}
 
@@ -75,7 +75,7 @@
 		inode->i_ctime = attr->ia_ctime;
 	if (ia_valid & ATTR_MODE) {
 		inode->i_mode = attr->ia_mode;
-		if (!fsuser() && !in_group_p(inode->i_gid))
+		if (!in_group_p(inode->i_gid) && !fsuser())
 			inode->i_mode &= ~S_ISGID;
 	}
 	mark_inode_dirty(inode);

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