Zohar81
Zohar81

Reputation: 5128

Load network/security extension in macOS. finish callback is skipped

i'm working on an endpoint security extension loader and implement several callbacks from delegate object OSSystemExtensionRequestDelegate

the callback i'm interested in is :

public func request(_ request: OSSystemExtensionRequest, 
                    didFinishWithResult result: OSSystemExtensionRequest.Result);

public func requestNeedsUserApproval(_ request: OSSystemExtensionRequest);

I've noticed that if I manually approve the extension long time after it was activated, the extension process goes up, but the callback isn't being called. The requestNeedUserApproval callback always gets called.

I see in the unified logs that when the extension goes from

activated_waiting_for_user -> activated_enabling -> activated_enabled

Than the request callback doesn't get called. But whenever the extension goes

activated_waiting_for_user -> activated_disabled

The request callback gets called. (this is counter intuitive since we expected the state activated_disabled may hint that the extension failed to be activated somehow)

Any Idea why my callback doesn't gets called if the extension gets approved long after it was activated ?

Upvotes: 0

Views: 35

Answers (1)

Witterquick
Witterquick

Reputation: 6140

It's very likely related to internal timers at the OS. The OS will create a different object for the activation flow, and the 'old' object's callback won't be called. This is more of a guess, but I had a similar problem with such a behavior in another component.

Upvotes: 0

Related Questions