- Resolve the Windows admin config via the ProgramData known folder instead of the user-controlled ProgramData variable, so a user cannot redirect the admin lookup and drop pinned labels - vendor rename rewrites matching agent-lib.labels.json entries, so a renamed item keeps its labels instead of going to every client - validate checks the labels file in repositories without a lockfile - A kept modified copy of a deselected item is no longer drift in status, and the toast explains it as "no longer assigned to you" - Labels parser rejects trailing data such as an extra closing brace - Tests: admin pin wiring (config chain, --repo, admin as chosen config), reselect redeploy with byte-level no-op, status labels JSON, validate without lockfile, rename keeps labels - README: document unreadable admin config, drift semantics, rename Refs: agent_lib-fh4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
521 B
Go
17 lines
521 B
Go
//go:build windows
|
|
|
|
package client
|
|
|
|
import "golang.org/x/sys/windows"
|
|
|
|
// programDataDir resolves the ProgramData known folder through the shell
|
|
// API instead of the ProgramData environment variable: the variable is
|
|
// user-controlled, and the admin config pins labels — a user must not be
|
|
// able to point the admin lookup at a folder of their own.
|
|
func programDataDir() string {
|
|
if p, err := windows.KnownFolderPath(windows.FOLDERID_ProgramData, 0); err == nil && p != "" {
|
|
return p
|
|
}
|
|
return `C:\ProgramData`
|
|
}
|