From 228a94387529bf11148647703c8573a164939865 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Mon, 28 Oct 2024 20:31:14 +0100 Subject: [PATCH] fix: do not trim 0 from process SELinux label Seems like a typo, zero is a valid character in SELinux labels Signed-off-by: Dmitry Sharshakov (cherry picked from commit 423b1e5fb22d9e785a3832741d796120b84a5e38) --- internal/pkg/miniprocfs/processes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/miniprocfs/processes.go b/internal/pkg/miniprocfs/processes.go index d6e78f39d3..03f24d9cb2 100644 --- a/internal/pkg/miniprocfs/processes.go +++ b/internal/pkg/miniprocfs/processes.go @@ -164,7 +164,7 @@ func (procs *Processes) readProc(pidString string) (*machine.ProcessInfo, error) var label string if err = procs.readFileIntoBuf(path + "attr/current"); err == nil { - label = string(bytes.Trim(procs.buf, "\x000\n")) + label = string(bytes.Trim(procs.buf, "\x00\n")) } return &machine.ProcessInfo{