sandbox_check returns false when checking current process sandbox state on Mac

Hello, I am using sandbox_init_with_parameter API to enable sandbox on current process. This API returns 0. But when I use sandbox_check to check whether current process is sandboxed, it returns false.

It only happens on a few user devices. I am wondering what could be wrong?

Those are not an API. The only APIs we have for custom sandboxes are those in <sandbox.h>, but:

  • Those have never been officially supported because, to do anything clever, you have to pass in the path to a .sb file and the SBPL has never been documented for third-party use.

  • The whole API has been deprecated.

I strongly recommend that you stay away from things that aren’t API. Implementation details like that are subject to change without notice.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

sandbox_check returns false when checking current process sandbox state on Mac
 
 
Q