fix(rootless_docker): widen subid range by adding the missing tail#38
Merged
Merged
Conversation
The grow-only widen combined --del-subuids and --add-subuids in one usermod. usermod runs a running-process guard for the delete half, and the runner user always has a live session (the lingering systemd --user manager), so the widen failed on exactly the converged hosts it targets. Widen additively instead: detect a contiguous block anchored at the declared start and add only the missing tail as a further contiguous range with a pure usermod --add, which succeeds on a live user. The existing lower ranges are an untouched prefix and rootlesskit maps every range, so the effective width is their sum. Detection treats a contiguous-from-start set summing to the count as satisfied and silent, so a widened host no longer warns every apply, while gapped, foreign, or overlapping ranges still warn or fail loud at the preflight. Refs #37
The rootless_docker section named the old mechanism (a single locked usermod del-before-add). Describe the additive tail instead: a pure usermod --add of the missing contiguous range, which grows the range even while the runner user's session is live.
Member
Author
|
Greenfield re-cert passed on a live Ubuntu 22.04 host with the rootless daemon up and a lingering
|
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.
What
Widen the runner's subordinate UID/GID range additively: add only the missing tail as a further contiguous range with a pure
usermod --add, instead of deleting and re-adding the range in oneusermodcall.Why
usermodruns a running-process guard on--del-subuids/--del-subgids, and the runner user always has a live session (the lingeringsystemd --usermanager), so the delete-and-re-add widen failed on exactly the converged, running hosts it targets: the widen exited 8, the daemon restart was skipped, and the apply errored. A pure--addis not guarded and succeeds on a live user. No released version is affected; the widen is unreleased behaviour.How
subid_count, add only the missing tail. The existing lower ranges stay as an untouched prefix, and rootlesskit maps every range, so the effective width is their sum.awkonlyifre-asserting the covered width, so a host changed since fact collection is skipped and the widen no-ops once the sum reaches the count.Verification
just checkgreen: puppet validate, lint, 148 examples/0 failures, docs-check.docker info,/proc/<dockerd-pid>/uid_map), not just apply exit 0.Closes #37