Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly parse user GID #88

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Correctly parse user GID #88

merged 1 commit into from
Jan 2, 2024

Conversation

clfs
Copy link
Contributor

@clfs clfs commented Dec 31, 2023

Background

SSH3 can incorrectly store a user's UID as a GID instead. This PR fixes that bug.

The responsible line is gid, err := strconv.Atoi(u.Uid).

Changes

  • Fix the bug by reading from u.Gid instead.
  • Use the correct number of arguments in nearby error messages.
  • Use strconv.ParseUint instead to reduce the number of type conversions.

Tests

  • go vet ./... and go test ./... pass.

@francoismichel francoismichel merged commit aecfb89 into francoismichel:main Jan 2, 2024
29 checks passed
@francoismichel
Copy link
Owner

Merged in aecfb89, thank you very much !

@clfs clfs deleted the patch-1 branch January 2, 2024 18:31
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.

None yet

2 participants