orangefs: Don't clear SGID when inheriting ACLs
authorJan Kara <jack@suse.cz>
Thu, 22 Jun 2017 13:31:13 +0000 (15:31 +0200)
committerMike Marshall <hubcap@omnibond.com>
Thu, 14 Sep 2017 18:54:37 +0000 (14:54 -0400)
commitb5accbb0dfae36d8d36cd882096943c98d5ede15
tree0f546045e8ab5b3dd2bfcd49762fca6845bd0418
parent569dbb88e80deb68974ef6fdd6a13edb9d686261
orangefs: Don't clear SGID when inheriting ACLs

When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
set, DIR1 is expected to have SGID bit set (and owning group equal to
the owning group of 'DIR0'). However when 'DIR0' also has some default
ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
'DIR1' to get cleared if user is not member of the owning group.

Fix the problem by creating __orangefs_set_acl() function that does not
call posix_acl_update_mode() and use it when inheriting ACLs. That
prevents SGID bit clearing and the mode has been properly set by
posix_acl_create() anyway.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
CC: stable@vger.kernel.org
CC: Mike Marshall <hubcap@omnibond.com>
CC: pvfs2-developers@beowulf-underground.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/acl.c