mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
19 lines
405 B
Go
19 lines
405 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build windows
|
|
|
|
package tstest
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
// hasSuperuserPrivileges reports whether the current process is elevated.
|
|
func hasSuperuserPrivileges() bool {
|
|
token, err := windows.OpenCurrentProcessToken()
|
|
if err != nil {
|
|
return false
|
|
}
|
|
defer token.Close()
|
|
return token.IsElevated()
|
|
}
|