Whamcloud - gitweb
LU-16012 sec: fix detection of SELinux enforcement 93/48193/3
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 27 Jul 2022 12:39:26 +0000 (12:39 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 10 Sep 2022 00:52:32 +0000 (00:52 +0000)
commit304b486fa310381733bc1fdbcd2b98a2f4077e2e
tree264e4f2a2627acf0fdd447cfe9a9a2b87aae1749
parent6d4559f6b948a93aaf5e94c4eb47cd9ebcf7ba95
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.

Lustre-change: https://review.whamcloud.com/48049
Lustre-commit: 155cbc22ba4f758cf9eec415f36f940ca2b23de9

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ifcdcb8ffbb7f9ad50d16d7d3317e94d0d212fa42
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/48193
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@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