From 58913f00845903aa2068f6cb0778baa563d58d14 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 19 Oct 2026 15:09:33 +0900 Subject: container/sysctl: remove calls to logger This behaviour is counterintuitive, the responses are cached, and only the msg object of the first call is used. This change also improves error message formatting of these functions. Signed-off-by: Ophestra --- container/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'container/init.go') diff --git a/container/init.go b/container/init.go index 07fff357..03501646 100644 --- a/container/init.go +++ b/container/init.go @@ -226,7 +226,7 @@ func initEntrypoint(k syscallDispatcher, msg message.Msg) { } // cache sysctl before pivot_root - lastcap := k.lastcap(msg) + lc := k.lastcap() if err := k.mount(zeroString, fhs.Root, zeroString, MS_SILENT|MS_SLAVE|MS_REC, zeroString); err != nil { k.fatalf(msg, "cannot make / rslave: %v", optionalErrorUnwrap(err)) @@ -399,7 +399,7 @@ func initEntrypoint(k syscallDispatcher, msg message.Msg) { if err := k.capAmbientClearAll(); err != nil { k.fatalf(msg, "cannot clear the ambient capability set: %v", err) } - for i := range lastcap + 1 { + for i := range lc + 1 { if slices.Contains(keepCaps, i) { continue } -- cgit v1.3.1