osx-sign
osx-sign copied to clipboard
Sandbox entitlement leads to crash at launch
Steps to reproduce :
- Take an electron app built for macOS, distributed outside of the app store, that does not include the sandbox entitlement.
- Using
codesignon the terminal command line, add the sandbox entitlement to the main app, the inherit entitlement (and the sandbox entitlement) to the children andElectronTeamIDto the main app. Sign all apps as appropriate.
Alternatively (this other procedure leads to the exact same issue):
- Take an electron app built for macOS, distributed outside of the app store, that does not include the sandbox entitlement.
- using electron-builder configuration, change
platform=darwintoplatform=mas, add the sandbox entitlement to the main app, the inherit entitlement (and the sandbox entitlement) to the children andElectronTeamIDto the main app. Sign all apps as appropriate with electron-builder.
Outcome : App crashes on launch with the following message:
Sandbox: QuickSample(2132) deny(1) network-bind /private/var/folders/s2/j1z79krx53qgms8l31r94_zc0000gn/T/com.electron.quicksample/S/SingletonSocket
Expected outcome : App launches appropriately
Interpretation :
It seems the entitlements work, but the electron app creates a UNIX domain socket (I assume for IPC between main app and helper) with a file descriptor in /var/folders. This directory is outside the app's container (it's a sandboxed app at that point), which macOS does not allow.
Possible resolution :
How can I force electron to start sockets inside the app's container (/Library/Containers/com.electron.quicksample/) ?