patch-2.3.20 linux/fs/open.c
Next file: linux/fs/sysv/inode.c
Previous file: linux/fs/nfsd/nfsfh.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
Thu Oct 7 10:17:09 1999
- Orig file:
v2.3.19/linux/fs/open.c
- Orig date:
Thu Aug 26 13:05:40 1999
diff -u --recursive --new-file v2.3.19/linux/fs/open.c linux/fs/open.c
@@ -526,10 +526,13 @@
* non-root user, remove the setuid bit.
* 19981026 David C Niemi <niemi@tux.org>
*
+ * Changed this to apply to all users, including root, to avoid
+ * some races. This is the behavior we had in 2.0. The check for
+ * non-root was definitely wrong for 2.2 anyway, as it should
+ * have been using CAP_FSETID rather than fsuid -- 19990830 SD.
*/
if ((inode->i_mode & S_ISUID) == S_ISUID &&
- !S_ISDIR(inode->i_mode)
- && current->fsuid)
+ !S_ISDIR(inode->i_mode))
{
newattrs.ia_mode &= ~S_ISUID;
newattrs.ia_valid |= ATTR_MODE;
@@ -539,9 +542,11 @@
* by a non-root user, remove the setgid bit UNLESS there is no group
* execute bit (this would be a file marked for mandatory locking).
* 19981026 David C Niemi <niemi@tux.org>
+ *
+ * Removed the fsuid check (see the comment above) -- 19990830 SD.
*/
if (((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP))
- && !S_ISDIR(inode->i_mode) && current->fsuid)
+ && !S_ISDIR(inode->i_mode))
{
newattrs.ia_mode &= ~S_ISGID;
newattrs.ia_valid |= ATTR_MODE;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)