fix(system_baseline): run the apt upgrade with TMPDIR outside /tmp and /var/tmp #377

Merged
Defame1297 merged 2 commits from fix/374-apt-tmpdir into main 2026-11-25 19:42:15 +00:00
2 Commits
Author SHA1 Message Date
Defame1297 ebac95e51d Merge branch 'main' into fix/374-apt-tmpdir
Build / build (pull_request) Successful in 25s
Lint / lint (pull_request) Successful in 1m48s
Molecule / molecule (pull_request) Successful in 3m11s
2026-11-25 19:38:19 +00:00
Dragonish 1bbf3368ee fix(system_baseline): run the apt upgrade with TMPDIR outside /tmp and /var/tmp
Build / build (pull_request) Successful in 31s
Lint / lint (pull_request) Canceled after 1m40s
Molecule / molecule (pull_request) Canceled after 1m13s
An openssh-server upgrade restarts ssh.service. With PrivateTmp=yes systemd
then deletes that unit's /tmp and /var/tmp, which removes the files apt
staged there while the upgrade is still running, so dpkg fails and leaves
packages unpacked but not configured.

The update flow now creates system_baseline_apt_tmpdir (root, mode 0700),
runs the upgrade and the autoremove with TMPDIR set to it, and opens a new
connection afterwards. The input is validated in the main flow and in the
update entry point: absolute, no "..", not under /tmp or /var/tmp.

Closes #374

Assisted-by: Claude Code:claude-sonnet-5-5
2026-11-25 19:21:01 +00:00