From d3c8c3dd004e727bfa85801ea9bf37b109c81f8c Mon Sep 17 00:00:00 2001 From: Derek Burdick Date: Mon, 5 Jun 2023 20:39:25 -0400 Subject: [PATCH] ssh/tailssh: Max Username Length 256 for linux Max username length is increased to 256 on linux to match /usr/include/bits/local_lim.h Fixes #8277 Signed-off-by: Derek Burdick --- ssh/tailssh/user.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ssh/tailssh/user.go b/ssh/tailssh/user.go index 0f2709e62..6acc66c07 100644 --- a/ssh/tailssh/user.go +++ b/ssh/tailssh/user.go @@ -81,7 +81,11 @@ func userLookup(username string) (*userMeta, error) { } func validUsername(uid string) bool { - if len(uid) > 32 || len(uid) == 0 { + maxUid := 32 + if runtime.GOOS == "linux" { + maxUid = 256 + } + if len(uid) > maxUid || len(uid) == 0 { return false } for _, r := range uid {