[linux] The systemd container test runs, and a ./ root entry no longer blocks a release (v0.1.1) #2

Manually merged
mnovak merged 4 commits from feature/linux-it into main 2026-11-17 13:13:33 +01:00
Owner

The Linux target's container test now runs, with real systemd (Docker Desktop on Mark's PC), and it found a real bug.

The bug: tar -C dir -czf x.tar.gz ., the usual way to pack a release, writes the root itself as a ./ directory entry; check_entry refused it as "a path outside the release", so such a release could never deploy. The root is now an allowed directory entry that names nothing; a file with an empty path is still refused. Tests first: check_entry (./, . for dirs and files) and an unpack of a ./-rooted archive.

The test tooling: tests/linux/Containerfile is two-stage (the test-only deploy example built in rust:1-slim-trixie, then Debian trixie with systemd as PID 1), built from the repo root as context, so no host folder is mounted (Docker Desktop's Hyper-V backend would need drive sharing). run.sh works with Docker or Podman, from Git Bash too, and removes its container and image.

Result with real systemd: 1.0.0 succeeds; 2.0.0 succeeds (previous 1.0.0); 3.0.0 crashes at start: rolled back to 2.0.0, healthy ("demo.service is not active"); 4.0.0 runs but fails its health URL: rolled back to 2.0.0, healthy; 2.0.0 keeps answering. PASS.

Workspace: 59 tests green on Windows; clippy clean. Version 0.1.1.

Self-review: could allowing ./ let anything escape? It yields no path components, so the extractor creates the release dir itself (already there) and nothing else; .., absolute paths, links and devices are refused as before.

The Linux target's container test now runs, with real systemd (Docker Desktop on Mark's PC), and it found a real bug. **The bug:** `tar -C dir -czf x.tar.gz .`, the usual way to pack a release, writes the root itself as a `./` directory entry; `check_entry` refused it as "a path outside the release", so such a release could never deploy. The root is now an allowed directory entry that names nothing; a *file* with an empty path is still refused. Tests first: `check_entry` (`./`, `.` for dirs and files) and an unpack of a `./`-rooted archive. **The test tooling:** `tests/linux/Containerfile` is two-stage (the test-only `deploy` example built in `rust:1-slim-trixie`, then Debian trixie with systemd as PID 1), built from the repo root as context, so no host folder is mounted (Docker Desktop's Hyper-V backend would need drive sharing). `run.sh` works with Docker or Podman, from Git Bash too, and removes its container and image. **Result with real systemd:** 1.0.0 succeeds; 2.0.0 succeeds (previous 1.0.0); 3.0.0 crashes at start: rolled back to 2.0.0, healthy ("demo.service is not active"); 4.0.0 runs but fails its health URL: rolled back to 2.0.0, healthy; 2.0.0 keeps answering. `PASS`. Workspace: 59 tests green on Windows; clippy clean. Version 0.1.1. **Self-review:** could allowing `./` let anything escape? It yields no path components, so the extractor creates the release dir itself (already there) and nothing else; `..`, absolute paths, links and devices are refused as before.
mnovak added 4 commits 2026-11-17 13:13:12 +01:00
mnovak manually merged commit 2f05807234 into main 2026-11-17 13:13:33 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/Legatus#2