From 14c0da1bfb2edccb322060ffbee3dac2d29fac51 Mon Sep 17 00:00:00 2001 From: Stephen Levine Date: Mon, 6 Oct 2025 18:35:19 -0400 Subject: [PATCH] [teleport-update] Fix SELinux warning and error breaking `teleport-update remove` (#59977) * Fix selinux warning * Update selinux_linux.go --- lib/selinux/selinux_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/selinux/selinux_linux.go b/lib/selinux/selinux_linux.go index 28663587156..14fcc66e942 100644 --- a/lib/selinux/selinux_linux.go +++ b/lib/selinux/selinux_linux.go @@ -22,6 +22,7 @@ import ( "bytes" "context" _ "embed" + "errors" "log/slog" "os" "path/filepath" @@ -226,6 +227,9 @@ func diagnoseWrongDomain(procCtx *selinuxContext, logger *slog.Logger) error { // ModuleInstalled returns true if the SSH SELinux module is installed. func ModuleInstalled() (bool, error) { selinuxType, err := readConfig(selinuxTypeTag) + if errors.Is(err, os.ErrNotExist) { + return false, nil + } if err != nil { return false, trace.Wrap(err, "failed to find SELinux type") }