Skip to contentSkip to conversation

chown in 2.5.8pre3

PATCH New [email protected] 1 participant 1 message Apr 14, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chown in 2.5.8pre3

In 2.5.8pre3 root cannot chown his files to some mortal. I have not read the code but blindly made the change below, and that fixed this particular problem for me.

Andries

open.c renamed from linux/2.5/linux-2.5.8-pre3/linux/fs/open.c +3 -3
@@ -522,13 +522,13 @@
 	error = -EPERM;
 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
 		goto out;
-	newattrs.ia_valid =  ATTR_CTIME;
+	newattrs.ia_valid = ATTR_CTIME;
 	if (user != (uid_t) -1) {
-		newattrs.ia_valid =  ATTR_UID;
+		newattrs.ia_valid |= ATTR_UID;
 		newattrs.ia_uid = user;
 	}
 	if (group != (gid_t) -1) {
-		newattrs.ia_valid =  ATTR_GID;
+		newattrs.ia_valid |= ATTR_GID;
 		newattrs.ia_gid = group;
 	}
 	if (!S_ISDIR(inode->i_mode))