]> git.baikalelectronics.ru Git - kernel.git/commit
hfsplus: Don't clear SGID when inheriting ACLs
authorJan Kara <jack@suse.cz>
Wed, 21 Jun 2017 13:02:47 +0000 (15:02 +0200)
committerJan Kara <jack@suse.cz>
Tue, 18 Jul 2017 16:23:39 +0000 (18:23 +0200)
commit54e3c7659c14915e9fd8c80742eb5841b533d533
tree448f85e72588b093c2e36289c5ef008e58bde754
parentfc45f2d5ace967b2711842d90d39a840cf0102f8
hfsplus: 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 __hfsplus_set_posix_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: b93308b56096afa920d6e36d3aad8d07e559d96e
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
fs/hfsplus/posix_acl.c