[client] Fall back to getent/id for SSH user lookup in static builds (#5510)

This commit is contained in:
Viktor Liu
2026-03-13 22:22:02 +08:00
committed by GitHub
parent d86875aeac
commit 529c0314f8
9 changed files with 848 additions and 18 deletions

View File

@@ -23,8 +23,8 @@ func isPlatformUnix() bool {
// Dependency injection variables for testing - allows mocking dynamic runtime checks
var (
getCurrentUser = user.Current
lookupUser = user.Lookup
getCurrentUser = currentUserWithGetent
lookupUser = lookupWithGetent
getCurrentOS = func() string { return runtime.GOOS }
getIsProcessPrivileged = isCurrentProcessPrivileged