mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
util/osdiag, util/winutil: expose Windows policy key
The Windows base registry key is already exported but the policy key was not. util/osdiag currently replicates the string rather than the preferred approach of reusing the constant. Updates #cleanup Change-Id: I6c1c45337896c744059b85643da2364fb3f232f2 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
This commit is contained in:
parent
855f79fad7
commit
1ef5bd5381
@ -54,7 +54,7 @@ func logSupportInfo(logf logger.Logf, reason LogSupportInfoReason) {
|
|||||||
func getSupportInfo(w io.Writer, reason LogSupportInfoReason) error {
|
func getSupportInfo(w io.Writer, reason LogSupportInfoReason) error {
|
||||||
output := make(map[string]any)
|
output := make(map[string]any)
|
||||||
|
|
||||||
regInfo, err := getRegistrySupportInfo(registry.LOCAL_MACHINE, []string{`SOFTWARE\Policies\Tailscale`, winutil.RegBase})
|
regInfo, err := getRegistrySupportInfo(registry.LOCAL_MACHINE, []string{winutil.RegPolicyBase, winutil.RegBase})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
output[supportInfoKeyRegistry] = regInfo
|
output[supportInfoKeyRegistry] = regInfo
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,9 +8,16 @@
|
|||||||
"os/user"
|
"os/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegBase is the registry path inside HKEY_LOCAL_MACHINE where registry settings
|
const (
|
||||||
// are stored. This constant is a non-empty string only when GOOS=windows.
|
// RegBase is the registry path inside HKEY_LOCAL_MACHINE where registry settings
|
||||||
const RegBase = regBase
|
// are stored. This constant is a non-empty string only when GOOS=windows.
|
||||||
|
RegBase = regBase
|
||||||
|
|
||||||
|
// RegPolicyBase is the registry path inside HKEY_LOCAL_MACHINE where registry
|
||||||
|
// policies are stored. This constant is a non-empty string only when
|
||||||
|
// GOOS=windows.
|
||||||
|
RegPolicyBase = regPolicyBase
|
||||||
|
)
|
||||||
|
|
||||||
// GetPolicyString looks up a registry value in the local machine's path for
|
// GetPolicyString looks up a registry value in the local machine's path for
|
||||||
// system policies, or returns empty string and the error.
|
// system policies, or returns empty string and the error.
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
const regBase = ``
|
const regBase = ``
|
||||||
|
const regPolicyBase = ``
|
||||||
|
|
||||||
var ErrNoValue = errors.New("no value because registry is unavailable on this OS")
|
var ErrNoValue = errors.New("no value because registry is unavailable on this OS")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user