]> git.karo-electronics.de Git - karo-tx-linux.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)
commit84969465ddc4f8aeb3b993123b571aa01c5f2683
tree448f85e72588b093c2e36289c5ef008e58bde754
parent34363c057b368114d8b93376ec6b65ef5f36a55b
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: 073931017b49d9458aa351605b43a7e34598caef
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
fs/hfsplus/posix_acl.c