Keep the rule for which commands reach run-heavy's docker beside that docker in capped_docker.py

This commit is contained in:
2026-11-08 11:09:17 +01:00
parent e2aca90c9c
commit 2321f4930d
6 changed files with 44 additions and 17 deletions
+4 -2
View File
@@ -18,9 +18,11 @@ PIECE = re.compile(r"""'[^']*'|"(?:\\.|[^"\\])*"|\\.|(?<![^\s;&|()])#[^\n]*""",
@dataclasses.dataclass(frozen=True)
class Launch:
"""A tool a simple command runs: the launchers it runs through, such as nice and run-heavy, and the words it is given."""
"""A tool a simple command runs: the launchers it runs through, such as nice and run-heavy, the word that names the tool as written, the words before that word and the words it is given."""
launchers: frozenset[str]
tool: str
word: str
before: list[str]
arguments: list[str]
@@ -107,4 +109,4 @@ def launched(words: list[str], tools: typing.Collection[str]) -> Launch | None:
at = next((i for i, name in enumerate(reachable) if name in tools), None)
if at is None:
return None
return Launch(frozenset(LAUNCHERS.intersection(names[:at])), names[at], words[at + 1:])
return Launch(frozenset(LAUNCHERS.intersection(names[:at])), names[at], words[at], words[:at], words[at + 1:])