Repository navigation
fix(exec): pass the container's OCI-spec user/HOME explicitly to podman/docker exec (#149) - #55
Conversation
…an/docker exec (issue #149) A container created during a concurrent bed window can resolve a broken exec session env (uid=1000 gid=0, empty HOME) even though its OCI spec carries uid/gid 1000/1000 + HOME=/home/user. The exec chain now reads the running container's .Config.User + .Config.Env (HOME) once at chain construction and passes them as explicit --user/--env HOME= on every podman/docker exec hop, making the session env deterministic. - NestedJump gains User/Home fields; wrapWithJump + StartProcess emit --user/--env HOME= when set. - ContainerChainFromDescriptor + AppendHopForFlatPath fill them from the container's OCI spec (best-effort; unreadable containers fall back to the engine's own resolution). - Tests: TestWrapWithJump_PodmanExplicitUserHome + TestParseContainerUserHome.
Review — BLOCKHead SHA: Change class: code fix (Go, exec env determinism) Blocks
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code fix (Go, exec env determinism) — runtime/code change. Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code fix (Go, exec env determinism) — runtime/code change. Blocks
Comment intake
Notes (non-blocking)
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Maintainer signoff — R10 bed requirement waived for this changeChange: spec/exec — the podman/docker exec chain now passes the container's OCI-spec user/HOME explicitly (--user --env HOME=) instead of relying on the engine's resolution, which races for containers created during a concurrent bed window (#149). R10 bed attempted: the concurrent two-bed reproduction (check-charly-selftest-pod + check-openclaw-full-pod) — required to reproduce the F-EXEC-HOME race. Why it cannot run: both beds fail at project-level candy resolution due to the Phase-4 standalone-repo bare-name refs (the sdk#174 + pod-github-runner#2 + pod-versatiles-frontend#2 + plugin-box#2 fixes are in the validator/merge pipeline). The bed infrastructure is un-runnable until those land. Signoff basis: the changed exec path was exercised live — a single-container live exec resolved uid=1000 gid=1000 HOME=/home/user with the emitted argv ["podman","exec","-i","--user","1000:1000","--env","HOME=/home/user",...], plus unit tests (TestWrapWithJump_PodmanExplicitUserHome, TestParseContainerUserHome). The concurrent-window reproduction is the defining scenario and cannot run until Phase-4 lands. Waiver: I sign off the concurrent-bed reproduction requirement for THIS change, contingent on the Phase-4 distro sweep landing the bed infrastructure (tracked #409). The exec fix is forward-compatible with the concurrent-bed verification once the beds run. — atrawog (maintainer) |
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, weakened guardrails, or supply-chain changes. The added Checklist: All applicable rules PASS or NA. The two prior BLOCK findings are resolved by the explicit maintainer signoff (atrawog, comment 5457022197):
Remaining checks: A1 body complete and ends with the Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, weakened guardrails, or supply-chain changes. The added Checklist: All applicable rules PASS or NA. The two prior BLOCK findings are resolved by the explicit maintainer signoff (atrawog, comment 5457022197):
Remaining checks: A1 body complete and ends with the Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, weakened guardrails, or supply-chain changes. The added Checklist: All applicable rules PASS or NA. The two prior BLOCK findings (A2/B12 required beds not run; B14(b)/R2 parking phrase) are resolved by the explicit maintainer signoff (atrawog, comment 5457022197): the R10 concurrent-bed reproduction genuinely cannot run — both beds fail at project-level candy resolution due to the Phase-4 bare-name refs (tracked #409), an infrastructure limitation independent of this change. The maintainer explicitly signs off waiving the concurrent-bed reproduction requirement for this change, with the basis stated (unit tests + live single-container exec resolving uid=1000 gid=1000 HOME=/home/user). This is a legitimate explicit operator sign-off for a portion that cannot be verified, and it names the batch (#409) rather than a vague deferral. Remaining checks: A1 body complete and ends with the Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
Fixes opencharly/charly#149 (F-EXEC-HOME): a container created during a concurrent bed window can resolve a broken exec session env —
uid=1000(user) gid=0(root)withHOMEempty — even though its OCI spec carriesuid/gid 1000/1000+HOME=/home/user. The exec chain now reads the running container's.Config.User+.Config.Env(HOME) once at chain construction and passes them as explicit--user/--env HOME=on every podman/docker exec hop, making the session env deterministic and immune to the engine's exec user/HOME resolution race.Changes:
NestedJumpgainsUser/Homefields;wrapWithJump+StartProcessemit--user/--env HOME=when set.ContainerChainFromDescriptor+AppendHopForFlatPathfill them from the container's OCI spec (best-effort; an unreadable container falls back to the engine's own resolution — the pre-fix behavior).TestWrapWithJump_PodmanExplicitUserHome+TestParseContainerUserHome.How tested
Live verification with a real container (user 1000:1000, HOME=/home/user):
The emitted argv carries the explicit
--user 1000:1000 --env HOME=/home/user, and the live exec resolvesuid=1000 gid=1000 HOME=/home/user.Bed-run attempt (2026-08-28):
charly check run check-charly-selftest-podwas attempted with a fresh worktree-built charly. The bed's image-build FAILS at the project-level candy resolution because the candy de-submodule cutover left OTHER boxes in the cachyos project referencing bare-name candies that no longer resolve (unknown candy llama-cpp/unsloth/selkies-core/clawhub/...). This is a known limitation of the CURRENT bed infrastructure (the Phase-4 standalone-repo ref sweep, tracked in charly#409), not a defect in this PR's change. The concurrent two-bed reproduction therefore cannot execute until that sweep lands. This PR's change is verified by the unit tests + the live single-container exec above; the bed infrastructure limitation is documented here, NOT deferred as a deliverable of this PR.Rulebook compliance
containerExecUserHomehelper; both exec paths (wrapWithJump + StartProcess) consume the same NestedJump fields--user/--env HOME=is the deterministic fix, not a retry/sleepChange classification
Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (analysed on a live system)