Commit 5f7f9062 authored by Shivakumar GN's avatar Shivakumar GN Committed by Alex Brainman

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
parent 05dc3bf5
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment