From: Daan De Meyer Date: Wed, 15 Jan 2025 11:06:53 +0000 (+0100) Subject: sandbox: Don't allow nested mkosi sandbox invocations X-Git-Tag: v25~52^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3363%2Fhead;p=thirdparty%2Fmkosi.git sandbox: Don't allow nested mkosi sandbox invocations Until a good usecase pops up it's probably best to disallow this since when it happens it's most likely a user error rather than intended. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 01ffbe3c5..5435279ab 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3766,6 +3766,12 @@ def in_sandbox() -> bool: def run_sandbox(args: Args, config: Config) -> None: + if in_sandbox(): + die( + "mkosi sandbox cannot be invoked from within another mkosi sandbox environment", + hint="Exit the current sandbox environment and try again", + ) + if not args.cmdline: die("Please specify a command to execute in the sandbox")