mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-26 11:35:35 +00:00
37925b3e7a
* We update wingoes to pick up new version information functionality (See pe/version.go in the https://github.com/dblohm7/wingoes repo); * We move the existing LogSupportInfo code (including necessary syscall stubs) out of util/winutil into a new package, util/osdiag, and implement the public LogSupportInfo function may be implemented for other platforms as needed; * We add a new reason argument to LogSupportInfo and wire that into localapi's bugreport implementation; * We add module information to the Windows implementation of LogSupportInfo when reason indicates a bugreport. We enumerate all loaded modules in our process, and for each one we gather debug, authenticode signature, and version information. Fixes #7802 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
31 lines
730 B
Go
31 lines
730 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package winutil
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
const (
|
|
localSystemSID = "S-1-5-18"
|
|
networkSID = "S-1-5-2"
|
|
)
|
|
|
|
func TestLookupPseudoUser(t *testing.T) {
|
|
localSystem, err := LookupPseudoUser(localSystemSID)
|
|
if err != nil {
|
|
t.Errorf("LookupPseudoUser(%q) error: %v", localSystemSID, err)
|
|
}
|
|
if localSystem.Gid != localSystemSID {
|
|
t.Errorf("incorrect Gid, got %q, want %q", localSystem.Gid, localSystemSID)
|
|
}
|
|
t.Logf("localSystem: %v", localSystem)
|
|
|
|
// networkSID is a built-in known group but not a pseudo-user.
|
|
_, err = LookupPseudoUser(networkSID)
|
|
if err == nil {
|
|
t.Errorf("LookupPseudoUser(%q) unexpectedly succeeded", networkSID)
|
|
}
|
|
}
|