Whamcloud - gitweb
LU-15184 llite: properly detect SELinux disabled case 27/45527/3
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 15 Nov 2021 19:06:31 +0000 (11:06 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 17 Nov 2021 18:44:14 +0000 (18:44 +0000)
commitbce5c5a9e38c41fa4c1ca4edc615380c4d3f453c
treef993225e35b093a4476cbf6518dde821bf2a8fb3
parent84f93a1833e250dccbed05c5c233b42be8276158
LU-15184 llite: properly detect SELinux disabled case

Usually, security_dentry_init_security() returns -EOPNOTSUPP when
SELinux is disabled. But on some kernels (e.g. rhel 8.5) it returns
0 when SELinux is disabled, and in this case the security context is
empty.
So in both cases make sure the security context name is not set, which
means "SELinux is disabled" for the rest of the code.

Lustre-change: https://review.whamcloud.com/45501
Lustre-commit: TBD (from 85779753abe0451e2b0b82dcf5d4a4d111b0bfb8)

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I3b9608f9768288de89570c158e8429560fa0213f
Reviewed-on: https://review.whamcloud.com/45527
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/xattr_security.c