Skip to content

llb: support uint32 numeric user and group IDs in parseUID - #7319

Closed
AdamMagued wants to merge 1 commit into
moby:masterfrom
AdamMagued:fix-issue-7292-parseuid-uint32
Closed

AdamMagued wants to merge 1 commit into
moby:masterfrom
AdamMagued:fix-issue-7292-parseuid-uint32

Conversation

@AdamMagued

Copy link
Copy Markdown

Support uint32 numeric user and group IDs in parseUID.

Linux user and group IDs are 32-bit unsigned integers. When parsing numeric IDs in the range [2147483648, 4294967295], strconv.ParseInt with bitSize 32 returned an ErrRange error. As a result, WithUser treated the numeric string as a username rather than a numeric ID, falling back to UID 0 (root) when the name was not found in /etc/passwd.

Switch parseUID to strconv.ParseUint(str, 10, 32), aligning with executor/oci/user.go.

Fixes #7292

Linux user and group IDs are 32-bit unsigned integers. When parsing
numeric IDs in the range [2147483648, 4294967295], strconv.ParseInt
with bitSize 32 returned an ErrRange error. As a result, WithUser
treated the numeric string as a username rather than a numeric ID,
falling back to UID 0 (root) when unresolved.

Switch parseUID to strconv.ParseUint(str, 10, 32), matching the parsing
logic in executor/oci/user.go.

Fixes moby#7292

Signed-off-by: AdamMagued <adamismailmageud@gmail.com>
@crazy-max

crazy-max commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

I'm closing this PR because the activity from this account raises concerns about automated PR farming. As of October 27, GitHub shows 1,114 authored PRs, including 22 opened on October 24 and 25. October 25 alone accounts for 14 PRs across 11 repositories, including react/react#37992, nodejs/node#66995, and opentofu/opentofu#4764.

The production change here is reasonable, but the new TestParseUID cases assign 2147483648 and math.MaxUint32 to an int field, which prevents the tests from compiling on 32-bit platforms. This also only addresses the numeric-ID portion of #7292; unresolved user and group names still retain default ownership, so the issue isn't fully fixed.

The activity pattern and validation gap leave me uncomfortable accepting further contributions from this account. That is a moderation judgment, not proof of automation. If I've misread the situation, please contact us through the community Slack and explain how you're personally reviewing and validating these contributions. I'm open to correcting my judgment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COPY --chown silently falls back to root

2 participants