writing to setuid files as root (or not)

Richard Kettlewell (richard@greenend.org.uk)
Thu, 28 Nov 96 00:31:41 +0000 (GMT)


In linux/fs/ext2/file.c in kernel 2.1.9:

static inline void remove_suid(struct inode *inode)
{
unsigned int mode;

/* set S_IGID if S_IXGRP is set, and always set S_ISUID */
mode = (inode->i_mode & S_IXGRP)*(S_ISGID/S_IXGRP) | S_ISUID;

/* was any of the uid bits set? */
mode &= inode->i_mode;
if (mode && suser()) {
inode->i_mode &= ~mode;
inode->i_dirt = 1;
}
}

It should be !suser() (as it was before this code moved out of
fs/read_write.c).

-- 
Richard Kettlewell               http://www.elmail.co.uk/staff/richard/

/dev/hdb5 - 0.5Gb of spinning metal, all alone in the night...