From 93d47fe9b98d1ef46143843716682c821dbef248 Mon Sep 17 00:00:00 2001 From: Ao Xu Date: Fri, 10 Aug 2018 02:14:25 -0400 Subject: [PATCH] Revert "Fix up non-directory creation in SGID directories" This reverts commit d2c7c52431819aa05d76fae77bb3f95dd0955da1. Change-Id: I096cd7fd49ccad4bd032bb365211930fa1aa74d4 Signed-off-by: Ao Xu --- fs/inode.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 1d1a957..3844c31 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2003,14 +2003,8 @@ void inode_init_owner(struct inode *inode, const struct inode *dir, inode->i_uid = current_fsuid(); if (dir && dir->i_mode & S_ISGID) { inode->i_gid = dir->i_gid; - - /* Directories are special, and always inherit S_ISGID */ if (S_ISDIR(mode)) mode |= S_ISGID; - else if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) && - !in_group_p(inode->i_gid) && - !capable_wrt_inode_uidgid(dir, CAP_FSETID)) - mode &= ~S_ISGID; } else inode->i_gid = current_fsgid(); inode->i_mode = mode; -- 2.7.4