generic: Check clearing of SGID in chmod and acl_set_file

Check if SGID is cleared upon chmod / setfacl when the owner is not
in the owning group.  As of today, the kernel fails to clear SGID in
setxattr (which is what acl_set_file is implemented on top of) in
that case; see this patch:

  https://patchwork.kernel.org/patch/9290507/

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Andreas Gruenbacher
2016-08-23 23:51:39 +02:00
committed by Eryu Guan
parent d6a6cf579f
commit d8fe99a265
3 changed files with 91 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
QA output created by 375
*** SGID should remain set (twice)
-rwxrwsrwx
-rwxrwsrwx
*** SGID should be cleared (twice)
-rwxrwxrwx
-rwxrwxrwx
*** Expected failure
chmod: changing permissions of 'testfile.375': Operation not permitted