]> Cypherpunks repositories - gostls13.git/commitdiff
os/user : use username as fullname if all else fails (on windows)
authorShivakumar GN <shivakumar.gn@gmail.com>
Wed, 3 Oct 2012 00:33:09 +0000 (10:33 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 3 Oct 2012 00:33:09 +0000 (10:33 +1000)
Fixes #4113.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6545054

src/pkg/os/user/lookup_windows.go

index 90fe0662e6824ee85ab055a27a1777caa8a4eaf7..3626a4e9f059b7b97d2f3fd151045877ffb4f83a 100644 (file)
@@ -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))