Whamcloud - gitweb
LU-15184 llite: properly detect SELinux disabled case 01/45501/3
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 9 Nov 2021 16:03:19 +0000 (17:03 +0100)
committerSebastien Buisson <sbuisson@ddn.com>
Mon, 15 Nov 2021 09:04:05 +0000 (10:04 +0100)
commit85779753abe0451e2b0b82dcf5d4a4d111b0bfb8
tree3165eb79f99f2fc8465112ec7bce2f60622b161e
parenta50eaae974ee04364c9fbbb4625dd3d581a8c986
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.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I3b9608f9768288de89570c158e8429560fa0213f
lustre/llite/xattr_security.c