From 48a56b1902eedf9fa1561bcf0a92aa5e3a202231 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 15 Jan 2025 12:06:53 +0100 Subject: [PATCH] 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. --- mkosi/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) 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") -- 2.47.2