diff --git a/subiquity/server/runner.py b/subiquity/server/runner.py index 06e59909..d196cc4c 100644 --- a/subiquity/server/runner.py +++ b/subiquity/server/runner.py @@ -27,11 +27,12 @@ class LoggedCommandRunner: def __init__(self, ident, *, use_systemd_user: Optional[bool] = None) -> None: self.ident = ident - self.env_whitelist = [ + self.env_allowlist = [ "PATH", "PYTHONPATH", "PYTHON", "TARGET_MOUNT_POINT", "SNAP", + "SUBIQUITY_REPLAY_TIMESCALE", ] if use_systemd_user is not None: self.use_systemd_user = use_systemd_user @@ -57,7 +58,7 @@ class LoggedCommandRunner: # --pipe also opens a pipe on stdin. This will effectively make the # child process behave differently if it reads from stdin. prefix.append("--pipe") - for key in self.env_whitelist: + for key in self.env_allowlist: with suppress(KeyError): prefix.extend(("--setenv", f"{key}={os.environ[key]}")) diff --git a/subiquity/server/tests/test_runner.py b/subiquity/server/tests/test_runner.py index 2989acb7..2d2b455c 100644 --- a/subiquity/server/tests/test_runner.py +++ b/subiquity/server/tests/test_runner.py @@ -53,7 +53,7 @@ class TestLoggedCommandRunner(SubiTestCase): "DUMMY": "should-not-be-exported", } - with patch.dict(os.environ, environ): + with patch.dict(os.environ, environ, clear=True): cmd = runner._forge_systemd_cmd( ["/bin/ls", "/root"], private_mounts=True, capture=False)