From 776650af01d56d1c38861420de7f4a077f0a61f8 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 10 Oct 2025 04:50:07 +0900 Subject: hst/config: negative WaitDelay bypasses default This behaviour might be useful, so do not lock it out. This change also fixes an oversight where the unchecked value is used to determine ForwardCancel. Signed-off-by: Ophestra --- internal/app/outcome.go | 4 +++- internal/app/spcontainer.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/app/outcome.go b/internal/app/outcome.go index 84a4bae3..0999ae91 100644 --- a/internal/app/outcome.go +++ b/internal/app/outcome.go @@ -81,7 +81,9 @@ func (s *outcomeState) populateEarly(k syscallDispatcher, msg message.Msg) { s.Shim = &shimParams{PrivPID: os.Getpid(), Verbose: msg.IsVerbose()} // enforce bounds and default early - if s.Container.WaitDelay <= 0 { + if s.Container.WaitDelay < 0 { + s.Shim.WaitDelay = 0 + } else if s.Container.WaitDelay == 0 { s.Shim.WaitDelay = hst.WaitDelayDefault } else if s.Container.WaitDelay > hst.WaitDelayMax { s.Shim.WaitDelay = hst.WaitDelayMax diff --git a/internal/app/spcontainer.go b/internal/app/spcontainer.go index b6378312..3426e7ea 100644 --- a/internal/app/spcontainer.go +++ b/internal/app/spcontainer.go @@ -65,7 +65,7 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { // the container is canceled when shim is requested to exit or receives an interrupt or termination signal; // this behaviour is implemented in the shim - state.params.ForwardCancel = state.Container.WaitDelay >= 0 + state.params.ForwardCancel = state.Shim.WaitDelay > 0 if state.Container.Multiarch { state.params.SeccompFlags |= seccomp.AllowMultiarch -- cgit v1.3.1