mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-24 03:06:38 +00:00
Fix more windows tests
This commit is contained in:
@@ -448,11 +448,8 @@ func TestSSHClient_PortForwardingDataTransfer(t *testing.T) {
|
||||
func getCurrentUsername() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
if currentUser, err := user.Current(); err == nil {
|
||||
username := currentUser.Username
|
||||
if idx := strings.LastIndex(username, "\\"); idx != -1 {
|
||||
username = username[idx+1:]
|
||||
}
|
||||
return strings.ToLower(username)
|
||||
// On Windows, return the full domain\username for proper authentication
|
||||
return currentUser.Username
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -430,7 +430,6 @@ func (pd *PrivilegeDropper) isLocalUser(domain string) bool {
|
||||
}
|
||||
|
||||
return domain == "" || domain == "." ||
|
||||
strings.EqualFold(domain, "localhost") ||
|
||||
strings.EqualFold(domain, hostname)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user