Repository navigation
A user's own group is one of its supplementary groups, as with Docker - #360
Open
cloudlabworks wants to merge 1 commit into
Open
cloudlabworks wants to merge 1 commit into
cloudlabworks wants to merge 1 commit into
Conversation
AndreKurait
added a commit
to AndreKurait/asagiri
that referenced
this pull request
Nov 16, 2026
Adapt public Kiri PR #360, preserving its author and original date. Run and exec now include their resolved primary group beside /etc/group and --group-add. Keep Asagiri's existing gid 0 behavior for unknown numeric users and check it. The enhanced run/exec fixture checks primary membership for all eleven user forms and explicit group-add. Native dev.99 reproduced the missing membership; the compiled Linux ARM64 production-helper and existing user-resolution unit tests pass in an owned native-guest container, which was verified removed. Full paired Docker/private-Asagiri run/exec validation remains pending CI. Upstream-PR: libracoder/kiri#360 Upstream-Commit: 996fbc5cd4ae9fccc868770c168ee336b104f2ac Co-authored-by: Andre Kurait <akurait@amazon.com> Signed-off-by: Andre Kurait <akurait@amazon.com>
AndreKurait
added a commit
to AndreKurait/asagiri
that referenced
this pull request
Nov 16, 2026
Return RFC3339Nano SystemTime from the same daemon clock as container events. This satisfies Compose 5.7's event-subscription precondition without waking a sleeping VM. Add a paired Docker/private-Asagiri fixture that binds the clock to retained volume events, checks later cutoffs and removes its owned volume. The cold information test also checks the timestamp and sleeping guest state. Register the strengthened public #360 user/group fixture on Docker as well as Asagiri. Preserve the existing unknown-numeric-user primary group checks. Native dev.99 reproduced missing SystemTime before any resource mutation. Local workspace: 721 top-level Rust tests passed, four ignored; Linux ARM64 init test executables compile; shell checks and clock-parser controls pass. Full daemon-time/Compose behavior still requires hosted and release validation. Upstream-Issue: libracoder/kiri#346 Related-PR: libracoder/kiri#360 Compose-Source: https://github.com/docker/compose/blob/v5.7.1/internal/logstream/monitor.go Signed-off-by: Andre Kurait <akurait@amazon.com>
docker run --user 1000:1000 gave a process with no supplementary groups; Docker gives it 1000, the user's group. The same for a named user (--user nobody: none on Kiri, 65534 on Docker) and for docker exec --user. Docker starts the list with the user's gid (usr.AdditionalGids in moby's getUser, daemon/oci_linux.go), then adds the /etc/group memberships and --group-add. Kiri now does the same in supplementary_groups. The list is sorted and deduplicated, so root shows 0 once where Docker lists it twice. Access through the primary group already worked; what differed is getgroups(), id, and Groups: in /proc/self/status. Left alone: for a numeric user that /etc/passwd doesn't have (--user 1000 in alpine), Docker uses gid 0 and Kiri uses the uid as the gid (resolve_user). That choice looks deliberate, so this change keeps it. Tests: - unit: the_users_own_group_is_a_supplementary_group_as_with_docker (groups_from takes the group file's text, no container needed) - e2e: user-groups-primary (-u 1000:1000 --group-add 2000 gives 1000 2000) and user-groups-exec (exec -u nobody gives 65534); both fail on 0.2.1 and pass with this change Tested: cargo test -p kiri-init in rust:1-alpine (aarch64, Rust 1.100.0): 71 passed, 1 failed; main gives 70 passed, 1 failed (the same layers::tests::whiteout_becomes_char_device, unprivileged container). cargo clippy and cargo fmt --check: same findings as main, none new. Then cargo xtask host + guest on Apple silicon, macOS 27.0.1, compared with Docker Engine 29.8.2 (OrbStack). Run only on Apple silicon so far; kiri-init is the runtime on all three platforms.
cloudlabworks
force-pushed
the
user-primary-gid-groups
branch
from
November 16, 2026 22:49
996fbc5 to
4a41280
Compare
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.
docker run --user 1000:1000on Kiri gives a process with no supplementarygroups; Docker gives it
1000. The same for a named user and fordocker exec --user. Docker starts the list with the user's gid(
usr.AdditionalGids = []uint32{usr.GID}in moby'sgetUser,daemon/oci_linux.go), then adds the/etc/groupmemberships and--group-add. Kiri now does the same, insupplementary_groups.Access through the primary group already worked (it is the process's gid);
what differed is
getgroups(),id, andGroups:in/proc/self/status.grep Groups /proc/self/statusinalpine:latest, Apple silicon, macOS 27.0.1:docker run ...--user)0 0 1 2 3 4 6 10 11 20 26 270 1 2 3 4 6 10 11 20 26 270 1 2 3 4 6 10 11 20 26 27--user nobody6553465534--user 1000:100010001000--user nobody:nogroup6553365533--user 65534:123412341234--user 1000:1000 --group-add 20001000 200020001000 2000--user nobody --group-add 20002000 6553420002000 65534exec --user 1000:100010001000exec --user nobody6553465534The list is sorted and deduplicated (the kernel sorts it anyway), so root
shows
0once where Docker lists it twice.One difference this PR leaves alone: for a numeric user that
/etc/passwddoesn't have (
--user 1000in alpine), Docker uses gid 0(
uid=1000 gid=0(root) groups=0(root)), and Kiri uses the uid as the gid(
uid=1000 gid=1000). So--user 1000now showsGroups: 1000on Kiri and0on Docker. Kiri's choice looks deliberate (resolve_user), so I did notchange it; say if you want it to match Docker.
Tests:
the_users_own_group_is_a_supplementary_group_as_with_docker(
groups_fromtakes the group file's text, so it runs without a container).user-groups-primary(-u 1000:1000 --group-add 2000gives1000 2000) anduser-groups-exec(exec -u nobodygives65534). Bothfail on 0.2.1 and pass with this change.
How it was tested:
cargo test -p kiri-initin arust:1-alpinecontainer(aarch64 Linux, Rust 1.100.0): 71 passed, 1 failed, where main gives 70 passed,
1 failed; the failure is
linux::layers::tests::whiteout_becomes_char_deviceon both (an unprivileged container).
cargo clippy -p kiri-init --all-targetsandcargo fmt --checkreport the same findings on main andon this branch, none in the changed lines (one is in this function on main
too: the nested
ifover/etc/groupmembers,collapsible_if, left as isto keep the diff small). Then
cargo xtask hoston the Macand
cargo xtask guestin that container, run as a second daemon: the tableabove.
Platforms:
kiri-initis the container runtime on all three systems (the VMon a Mac, beside
kirion a Linux host, and in WSL on Windows), so the changeis the same everywhere. Run only on Apple silicon so far.