]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
vfs: Add new setgid_create_umask test
authorYang Xu <xuyang2018.jy@fujitsu.com>
Wed, 31 Aug 2022 07:33:26 +0000 (15:33 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 4 Sep 2022 13:47:03 +0000 (21:47 +0800)
commitc875434286737e792d200cda2eb679e2a8441837
tree256682e12635d82f35259fb85b6b36285690a0f4
parentde3717ae0985b9cda9d99a1290dbb5d8915cf089
vfs: Add new setgid_create_umask test

The current_umask() is stripped from the mode directly in the vfs if the
filesystem either doesn't support acls or the filesystem has been
mounted without posic acl support.

If the filesystem does support acls then current_umask() stripping is
deferred to posix_acl_create(). So when the filesystem calls
posix_acl_create() and there are no acls set or not supported then
current_umask() will be stripped.

This patch is also designed to test kernel patch behaviour
"move S_ISGID stripping into the vfs* helper"

Here we only use umask(S_IXGRP) to check S_ISGID stripping whether works
correctly and S_IXGRP mode still exists.

Also use noacl mount option to test another kernel bug
fs: Add missing umask strip in vfs_tmpfile

Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/vfs/idmapped-mounts.c
src/vfs/idmapped-mounts.h
src/vfs/utils.c
src/vfs/utils.h
src/vfs/vfstest.c
tests/generic/696 [new file with mode: 0755]
tests/generic/696.out [new file with mode: 0644]