trilemma-dev / SecureXPC

A simple and secure XPC framework for Swift
MIT License
75 stars 15 forks source link

Verify that exporting a connection for a Mach service works correctly #33

Closed amomchilov closed 2 years ago

amomchilov commented 2 years ago

https://github.com/trilemma-dev/SecureXPC/blob/ab4e612fd83ae3afef76e455831ae3ce9fe07f0d/Sources/SecureXPC/Server/XPCMachServer.swift#L204-L208

Fatal-error this code path to say that it's untested, and treat it as effectively not-yet-implemented.

...

Let's go with option 2 for now. I'd volunteer to try testing it out, but between end of year busyness at work and heading off on holiday soon I just won't have time before early January. Can revisit it then.

_Originally posted by @jakaplan in https://github.com/trilemma-dev/SecureXPC/pull/23#discussion_r769131546_

jakaplan commented 2 years ago

I've very briefly started looking into this, but haven't done any actual testing yet. I'd be rather surprised if what we currently have works in all cases as it's inconsistent:

If it's true that there's no equivalent for XPC Services and therefore no way to return an XPCServerEndpoint, I think we could do one or both of the following:

jakaplan commented 2 years ago

I've confirmed that exporting a connection for an XPCMachServer works correctly. So in terms of exactly this issue, I've put up PR #45 for this.

Since this does work and it differs from XPCServiceServer's behavior, educated guess that the endpoint for the XPCServiceServer doesn't work properly (and probably can't work). I've created issue #46 for this.