fix(oci): apply absolute symlink resolution to /etc/group#12925
Open
pauloappbr wants to merge 1 commit intocontainerd:mainfrom
Open
fix(oci): apply absolute symlink resolution to /etc/group#12925pauloappbr wants to merge 1 commit intocontainerd:mainfrom
pauloappbr wants to merge 1 commit intocontainerd:mainfrom
Conversation
fuweid
requested changes
Feb 21, 2026
Member
fuweid
left a comment
There was a problem hiding this comment.
Thanks. The change looks good. However, please add the UT to cover this case.
1176e7f to
a5bf049
Compare
Contributor
Author
Done! Added TestGroupLookup_AbsoluteSymlink covering both GIDFromFS and getSupplementalGroupsFromFS absolute symlink resolution. |
This is a follow-up to PR containerd#12732. As noted by @TheColorman, while the previous PR successfully resolved absolute symlinks pointing outside the mount root for /etc/passwd during user lookups, the same logic was missing for group lookups. This caused `openat etc/group: path escapes from parent` errors when /etc/group was also an absolute symlink (e.g., in NixOS environments). This patch updates GIDFromFS, getSupplementalGroupsFromFS, and WithAppendAdditionalGroups to use the openUserFile helper, ensuring absolute symlinks are correctly re-anchored across all OCI user/group resolution paths. Includes unit test for validation. Fixes containerd#12683 Signed-off-by: Paulo Oliveira <paulo.hco47@gmail.com>
b98247f to
fc406db
Compare
fuweid
approved these changes
Feb 22, 2026
10 tasks
|
Thanks for this @pauloappbr MR tested on NixOS - NixOS/nixpkgs#482748 (comment) and runs fine. (In NixOS we can add patches (commits/MRs) to packages in a simple way, and have a rather powerful test system to test packages with) BR |
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.
This is a follow-up to PR #12732.
As noted by @TheColorman, while the previous PR successfully resolved absolute symlinks pointing outside the mount root for
/etc/passwdduring user lookups, the same logic was missing for group lookups. This causedopenat etc/group: path escapes from parenterrors when/etc/groupwas also an absolute symlink (e.g., in NixOS environments).This patch updates
GIDFromFS,getSupplementalGroupsFromFS, andWithAppendAdditionalGroupsto use theopenUserFilehelper, ensuring absolute symlinks are correctly re-anchored across all OCI user/group resolution paths.Fixes #12683
Signed-off-by: Paulo Oliveira paulo.hco47@gmail.com