Skip to content

user: add test-cases for maxID (math.MaxInt32)#221

Open
thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:limit_uidgid
Open

user: add test-cases for maxID (math.MaxInt32)#221
thaJeztah wants to merge 1 commit into
moby:mainfrom
thaJeztah:limit_uidgid

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented May 26, 2026

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review May 26, 2026 10:46
Copy link
Copy Markdown
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only tests the case where gid/uid still falls within int .

If it's larger, it will still resolve to root because it will be treated as an username and still resolved.

So:

9223372036854775808:x:0:0:root:/root:/bin/sh
  • USER 9223372036854775808

Means that the runtime will actually resolve it to root.

This is "correct" behavior, but its confusing to treat a numeric value as an username.

@thaJeztah
Copy link
Copy Markdown
Member Author

@vvoland - trying to see where that codepath would be; testing GetExecUser with 2147483648 (math.MaxInt32 + 1) produces an error; or is it a different codepath you're looking at?

@vvoland
Copy link
Copy Markdown
Contributor

vvoland commented May 26, 2026

On 64 bit strconv.Atoi will handle MaxInt32 + 1 without an error

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants