mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
fix: selinux detection
Fix SELinux detection. Fixes: #10965 Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
parent
52c76ea3a6
commit
ea5de19fad
@ -34,7 +34,13 @@ var IsEnabled = sync.OnceValue(func() bool {
|
||||
|
||||
val := procfs.ProcCmdline().Get(constants.KernelParamSELinux).First()
|
||||
|
||||
return val != nil && *val == "1"
|
||||
var selinuxFSPresent bool
|
||||
|
||||
if _, err := os.Stat("/sys/fs/selinux"); err == nil {
|
||||
selinuxFSPresent = true
|
||||
}
|
||||
|
||||
return val != nil && *val == "1" && selinuxFSPresent
|
||||
})
|
||||
|
||||
// IsEnforcing checks if SELinux is enabled and the mode should be enforcing.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user