mirror of
https://github.com/golang/go
synced 2024-11-26 03:27:58 -07:00
os/user : use username as fullname if all else fails (on windows)
Fixes #4113. R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/6545054
This commit is contained in:
parent
05dc3bf572
commit
5f7f9062db
@ -27,7 +27,9 @@ func lookupFullName(domain, username, domainAndUser string) (string, error) {
|
||||
var p *byte
|
||||
e = syscall.NetUserGetInfo(d, u, 10, &p)
|
||||
if e != nil {
|
||||
return "", e
|
||||
// path executed when a domain user is disconnected from the domain
|
||||
// pretend username is fullname
|
||||
return username, nil
|
||||
}
|
||||
defer syscall.NetApiBufferFree(p)
|
||||
i := (*syscall.UserInfo10)(unsafe.Pointer(p))
|
||||
|
Loading…
Reference in New Issue
Block a user