Whamcloud - gitweb
LU-16012 sec: fix detection of SELinux enforcement 49/48049/4
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 27 Jul 2022 12:39:26 +0000 (12:39 +0000)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Sep 2022 05:54:41 +0000 (05:54 +0000)
commit155cbc22ba4f758cf9eec415f36f940ca2b23de9
tree011d45c69e01017aabf3ca18d341e402427a8f73
parent807f3a07799cf30dedc50db4e529267c3ff3c3d6
LU-16012 sec: fix detection of SELinux enforcement

On newer distros (e.g. RHEL 9.0), on which selinux_is_enabled() does
not exist anymore, the only way to find out if SELinux is enforced
when initializing the security context is to fetch the length of the
security attribute name. If it is 0, we conclude SELinux is disabled.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ifcdcb8ffbb7f9ad50d16d7d3317e94d0d212fa42
Reviewed-on: https://review.whamcloud.com/48049
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dir.c
lustre/llite/llite_internal.h
lustre/llite/namei.c
lustre/llite/xattr_security.c