Skip to content

Commit 5f7f906

Browse files
shivakumargnalexbrainman
authored andcommitted
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
1 parent 05dc3bf commit 5f7f906

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pkg/os/user/lookup_windows.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ func lookupFullName(domain, username, domainAndUser string) (string, error) {
2727
var p *byte
2828
e = syscall.NetUserGetInfo(d, u, 10, &p)
2929
if e != nil {
30-
return "", e
30+
// path executed when a domain user is disconnected from the domain
31+
// pretend username is fullname
32+
return username, nil
3133
}
3234
defer syscall.NetApiBufferFree(p)
3335
i := (*syscall.UserInfo10)(unsafe.Pointer(p))

0 commit comments

Comments
 (0)