[PATCH v2 2/6] generic/314, afs: Allow for a filesystem that doesn't honour SGID inheritance
Zorro Lang
zlang at redhat.com
Wed Apr 26 07:35:24 PDT 2023
On Mon, Apr 24, 2023 at 03:10:38PM +0100, David Howells wrote:
> The AFS filesystem doesn't do any special handling for the SUID, SGID and
> SVTX bits and doesn't perform any sort of propagation. Further, only a
> user with cell admin rights can set non-0777 bits.
>
> Handle this by adding a "_require_sgid_inheritance" clause and labelling
> the test with it, thereby skipping for filesystems that don't support it.
>
> Signed-off-by: David Howells <dhowells at redhat.com>
> Reviewed-by: Darrick J. Wong <djwong at kernel.org>
> cc: linux-afs at lists.infradead.org
> ---
Make sense to me,
Reviewed-by: Zorro Lang <zlang at redhat.com>
> common/rc | 9 +++++++++
> doc/requirement-checking.txt | 7 +++++++
> tests/generic/314 | 1 +
> 3 files changed, 17 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 8b8cb714..00c5fcfe 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -5097,6 +5097,15 @@ _save_coredump()
> $COREDUMP_COMPRESSOR -f "$out_file"
> }
>
> +_require_sgid_inheritance()
> +{
> + case $FSTYP in
> + afs)
> + _notrun "SGID-based group ID inheritance is not supported on $FSTYP"
> + ;;
> + esac
> +}
> +
> init_rc
>
> ################################################################################
> diff --git a/doc/requirement-checking.txt b/doc/requirement-checking.txt
> index 45d2756b..a3588ee9 100644
> --- a/doc/requirement-checking.txt
> +++ b/doc/requirement-checking.txt
> @@ -16,6 +16,7 @@ they have. This is done with _require_<xxx> macros, which may take parameters.
>
> _require_chattr <letters>
> _require_exportfs
> + _require_sgid_inheritance
>
> (3) System call requirements.
>
> @@ -97,6 +98,12 @@ _require_exportfs
> The test also requires the use of the open_by_handle_at() system call and
> will be skipped if it isn't available in the kernel.
>
> +_require_sgid_inheritance
> +
> + The test required that the $TEST_DEV filesystem supports the inheritance
> + of the SGID bit and the GID from a marked directory. The test will be
> + skipped if not supported.
> +
>
> ========================
> SYSTEM CALL REQUIREMENTS
> diff --git a/tests/generic/314 b/tests/generic/314
> index 9449d30f..dd617089 100755
> --- a/tests/generic/314
> +++ b/tests/generic/314
> @@ -17,6 +17,7 @@ _supported_fs generic
> _require_test
> _require_user
> _require_chown
> +_require_sgid_inheritance
>
> rm -rf $TEST_DIR/$seq-dir
>
>
More information about the linux-afs
mailing list