Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / remove-suid-2.4-rhel.patch
1 --- uml-2.4.24/mm/filemap.c.orig        2005-02-18 22:27:31.000000000 +0200
2 +++ uml-2.4.24/mm/filemap.c     2005-02-18 22:49:02.960952568 +0200
3 @@ -2993,7 +2993,20 @@ inline void remove_suid(struct inode *in
4         /* was any of the uid bits set? */
5         mode &= inode->i_mode;
6         if (mode && !capable(CAP_FSETID)) {
7 +               struct inode_operations *op = inode->i_op;
8                 inode->i_mode &= ~mode;
9 +
10 +               if (op && op->setattr_raw) {
11 +                       struct iattr newattrs;
12 +                       int result;
13 +                       newattrs.ia_mode = inode->i_mode;
14 +
15 +                       newattrs.ia_valid = ATTR_FORCE | ATTR_MODE;
16 +                       result = op->setattr_raw(inode, &newattrs);
17 +                       /* the file system wants to use normal vfs path now */
18 +                       if (result != -EOPNOTSUPP)
19 +                               return; /* No way to return status. Whoops! */
20 +               }
21                 mark_inode_dirty(inode);
22         }
23  }