From 9c1a5d43bad802aa0ad717ea603c51f7b0408cdd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 17 Aug 2025 01:43:11 +0900 Subject: container: enforce nonrepeatable autoetc and autoroot These keep track of some internal state, and they don't make sense to have multiple instances of anyway, so instead of dealing with that, just make them nonrepetable. Signed-off-by: Ophestra --- container/autoroot.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'container/autoroot.go') diff --git a/container/autoroot.go b/container/autoroot.go index b155145c..215a7bb3 100644 --- a/container/autoroot.go +++ b/container/autoroot.go @@ -56,6 +56,11 @@ func (r *AutoRootOp) early(state *setupState) error { } func (r *AutoRootOp) apply(state *setupState) error { + if state.nonrepeatable&nrAutoRoot != 0 { + return msg.WrapErr(syscall.EINVAL, "autoroot is not repeatable") + } + state.nonrepeatable |= nrAutoRoot + for _, op := range r.resolved { msg.Verbosef("%s %s", op.prefix(), op) if err := op.apply(state); err != nil { -- cgit v1.3.1