control/controlclient,posture,util/syspolicy: use predefined syspolicy keys instead of string literals

With the upcoming syspolicy changes, it's imperative that all syspolicy keys are defined in the syspolicy package
for proper registration. Otherwise, the corresponding policy settings will not be read.

This updates a couple of places where we still use string literals rather than syspolicy consts.

Updates #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2024-09-04 12:01:55 -05:00
committed by Nick Khyl
parent d060b3fa02
commit 11d205f6c4
3 changed files with 10 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ import (
// MDM solution. It requires configuration via the DeviceSerialNumber system policy.
// This is the only way to gather serial numbers on iOS and tvOS.
func GetSerialNumbers(_ logger.Logf) ([]string, error) {
s, err := syspolicy.GetString("DeviceSerialNumber", "")
s, err := syspolicy.GetString(syspolicy.DeviceSerialNumber, "")
if err != nil {
return nil, fmt.Errorf("failed to get serial number from MDM: %v", err)
}