Whamcloud - gitweb
LU-15184 llite: properly detect SELinux disabled case
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 30 Nov 2021 00:23:35 +0000 (16:23 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 4 Dec 2021 06:42:18 +0000 (06:42 +0000)
commitcf2b71774d81a3f6e1a8a73569242cf37d8caa6f
tree6b03dec31732dcadec5e791cf565ca910edf8985
parent68f92ed37b2b1a33717af162fd9b60ccdeb1c0ab
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: 42661f7ba106b7d2e02f85a65880061585ca6ccb

Test-Parameters: trivial

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