mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
[client] Fall back to getent/id for SSH user lookup in static builds (#5510)
This commit is contained in:
@@ -49,10 +49,14 @@ func getWindowsUserShell() string {
|
||||
return `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`
|
||||
}
|
||||
|
||||
// getUnixUserShell returns the shell for Unix-like systems
|
||||
// getUnixUserShell returns the shell for Unix-like systems.
|
||||
// Tries /etc/passwd first (fast, no subprocess), falls back to getent for NSS users.
|
||||
func getUnixUserShell(userID string) string {
|
||||
shell := getShellFromPasswd(userID)
|
||||
if shell != "" {
|
||||
if shell := getShellFromPasswd(userID); shell != "" {
|
||||
return shell
|
||||
}
|
||||
|
||||
if shell := getShellFromGetent(userID); shell != "" {
|
||||
return shell
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user