lkml.org 
[lkml]   [1996]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subjectwriting to setuid files as root (or not)

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...

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.028 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site