Read the MDM policy through the Loader API

This commit is contained in:
Viktor Liu
2026-09-16 11:22:27 +02:00
parent 27b2dafc38
commit fcd5e2dcf1
+4 -1
View File
@@ -124,7 +124,10 @@ func (p *program) Start(svc service.Service) error {
// on a managed host it may be carrying the restriction, and treating it as
// absent would serve every local account instead.
func (p *program) listenRestricted() (*socketListener, *socketListener, error) {
policy, err := mdm.LoadPolicyWithError()
// A nil fetcher leaves the platform-native source authoritative, which is
// what a desktop daemon wants. This runs before the Server exists, so it
// cannot borrow the Loader the Server owns.
policy, err := mdm.NewLoader(nil).LoadWithError()
if err != nil {
return nil, nil, err
}