mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-29 11:01:29 +02:00
19 lines
352 B
Go
19 lines
352 B
Go
//go:build windows
|
|
|
|
package server
|
|
|
|
import (
|
|
"os/user"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/ipcauth"
|
|
)
|
|
|
|
// usernameForIdentity resolves a Windows caller's SID to its account name.
|
|
func usernameForIdentity(id ipcauth.Identity) (string, error) {
|
|
u, err := user.LookupId(id.SID)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return u.Username, nil
|
|
}
|