Whamcloud - gitweb
LU-15184 llite: properly detect SELinux disabled case 01/45501/4
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 9 Nov 2021 16:03:19 +0000 (17:03 +0100)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Nov 2021 03:49:31 +0000 (03:49 +0000)
commit42661f7ba106b7d2e02f85a65880061585ca6ccb
treeed18911f0890d5a11d6291d67e32dd9c43f6de35
parent283f7f247b938d13e3f88567dd71869d99146208
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
Reviewed-on: https://review.whamcloud.com/45501
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/xattr_security.c