--dry-run names the engine binary and which of $SNUG_PODMAN/$SNUG_PODMAN_ROOT/PATH resolved it (closes #278) - #279
Merged
Merged
Conversation
…#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
engine binary /opt/snug-podman/bin/podman ($SNUG_PODMAN) — trusted outright, PATH resolution bypassed on purposeplus thebundle root ($SNUG_PODMAN_ROOT)line when set.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