Skip to content

--dry-run names the engine binary and which of $SNUG_PODMAN/$SNUG_PODMAN_ROOT/PATH resolved it (closes #278) - #279

Merged
vyskocilm merged 2 commits into
mainfrom
issue-34-engine-disclosure
Aug 21, 2026
Merged

--dry-run names the engine binary and which of $SNUG_PODMAN/$SNUG_PODMAN_ROOT/PATH resolved it (closes #278)#279
vyskocilm merged 2 commits into
mainfrom
issue-34-engine-disclosure

Conversation

@vyskocilm

Copy link
Copy Markdown
Contributor

Closes #278.

--dry-run described the toolchain graft when one existed but never named the engine binary the run resolves, or which of $SNUG_PODMAN / $SNUG_PODMAN_ROOT / PATH answered. A host with a host-escape shim on PATH and $SNUG_PODMAN exported starts a different binary than one without, and the CONTAINERS block was silent about which you are on. --dry-run is the screen a human trusts; it must not be silent about which engine it starts.

Not a trust gap — a disclosure gap. The two env vars are deliberately trusted and that stays: preflightPodmanBinary (containerpreflight.go:442) trusts $SNUG_PODMAN outright to BYPASS a shim on PATH — re-resolving from PATH would ask the wrong question about a binary the caller never asked to use; $SNUG_PODMAN_ROOT (:121) names a bundle root not recoverable from the binary path.

Fix: describeEngineSource adds one line to the CONTAINERS block naming the source.

  • pinned: engine binary /opt/snug-podman/bin/podman ($SNUG_PODMAN) — trusted outright, PATH resolution bypassed on purpose plus the bundle root ($SNUG_PODMAN_ROOT) line when set.
  • unpinned: engine binary resolved from PATH when the run starts — preflight P1 refuses a host-escape shim there; --dry-run does not probe PATH, so it names the source, not the binary.

Stays OFFLINE, which is the design point: it names the SOURCE, not a probed binary, for PATH — --dry-run runs no preflight (dryrun.go:2044), and resolving podman from PATH would mean a host PATH search plus the shim readlink chain. Env vars are read, not the filesystem: a $SNUG_PODMAN naming a nonexistent path still prints (measured, no stat). Host-controlled values go through visibleValue, same guard every other value on this screen uses.

Golden diff is the review artifact: two PATH-case containers.podman-*.txt gain the line, new containers.podman-pinned.txt covers the $SNUG_PODMAN branch. TestGoldenContainers clears both env vars so the PATH goldens do not depend on a developer's shell; TestGoldenContainersEnginePinned sets them. VERIFY 2a is the by-hand check.

make gate green; make build + the two --dry-run invocations produce the block shown above.

🤖 Generated with Claude Code

vyskocilm and others added 2 commits August 21, 2026 16:51
…#278)

--dry-run described the toolchain graft when one existed but never named the
engine binary the run resolves, or which of $SNUG_PODMAN / $SNUG_PODMAN_ROOT /
PATH answered. A host with a host-escape shim on PATH and $SNUG_PODMAN exported
starts a different binary than one without, and the screen a human trusts was
silent about which. Not a trust gap — the two env vars are deliberately trusted
(preflightPodmanBinary trusts $SNUG_PODMAN outright to bypass a shim on PATH;
$SNUG_PODMAN_ROOT names a bundle root not recoverable from the binary path) — a
disclosure gap.

describeEngineSource adds one line to the CONTAINERS block naming the source.
Stays OFFLINE: it names the SOURCE, not a probed binary, for the PATH case,
because --dry-run runs no preflight and resolving podman from PATH would mean a
host PATH search plus the shim readlink chain. Env vars are read, not the
filesystem, so a $SNUG_PODMAN naming a nonexistent path still prints (no stat).
Values are host-controlled, so both go through visibleValue.

Golden: two PATH-case containers.podman-*.txt gain the line; new
containers.podman-pinned.txt covers the $SNUG_PODMAN branch. TestGoldenContainers
clears both env vars so the PATH goldens do not depend on a developer's shell;
TestGoldenContainersEnginePinned sets them. VERIFY 2a is the by-hand check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vyskocilm
vyskocilm merged commit 9340c9b into main Aug 21, 2026
5 checks passed
@vyskocilm
vyskocilm deleted the issue-34-engine-disclosure branch August 21, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--dry-run does not name the engine binary the run resolved, or which of $SNUG_PODMAN/$SNUG_PODMAN_ROOT/PATH answered

1 participant