fix(test): hand E2E evidence back to the right user under rootless Docker - #87
Merged
Conversation
…cker The Linux E2E passes under rootless Docker, but its evidence came back unreadable, and the run ended on sha256sum failing to open the manifest it had just written. The container writes evidence as its own non-root user. restore_evidence_owner chowned that back to $(id -u) from inside the container, which is correct only because rootful Docker maps uid to uid — the mapping CI runs under, which is why this was never noticed. Rootless inverts it: container root maps to the invoking user, and every other container id maps to a subuid the user cannot read. Chowning to 1004 there produces another subuid, not the caller. Detect the daemon mode and chown to 0:0 when rootless. Rootful behaviour, and therefore CI, is unchanged. Verified locally on rootless: evidence lands owned by the invoking user with 0600 intact, sha256sum -c passes, and the suite's own mode assertions still hold. CONTRIBUTING notes that rootless is supported.
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.
Found while getting the Linux E2E running locally on a rootless Docker daemon.
Symptom
The E2E passes — including Chromium's nested namespace sandbox, which is the part worth knowing works — but the run then dies on its own manifest:
The evidence was all there, owned by an id the invoking user cannot read.
Cause
The container writes evidence as its own non-root user, and
restore_evidence_ownerchowns it back to$(id -u)from inside the container. That is correct only under the uid-for-uid mapping of a rootful daemon — the one CI uses, which is why this never surfaced.Rootless inverts the mapping. Measured on this machine:
root(0)headless(10001)So chowning to
1004inside the container lands on another subuid rather than the caller.Fix
Detect the daemon mode and chown to
0:0when rootless. Rootful behaviour, and therefore CI, is unchanged — theelsebranch is exactly what ran before.Verified
On rootless, before: evidence owned by
372144,sha256sum -cfails. After: owned by the invoking user,0600intact,sha256sum -cpasses, and the suite's own file-mode assertions still hold. Full run is 1m11s warm.Worth stating plainly: I cannot verify the rootful path locally — this machine has no rootful daemon. That path is unchanged code, and CI exercises it on every run of this PR, which is the evidence for it.
CONTRIBUTING.mdnow notes that rootless is supported, since it is a reasonable default on shared machines where thedockergroup is effectively passwordless root.