SMJobBlessXPC icon indicating copy to clipboard operation
SMJobBlessXPC copied to clipboard

SMJobBless buggy?

Open evanlooij opened this issue 7 years ago • 2 comments

I've been running SMJobBlessXPC, without the sandbox, but with code-signing and I noticed a pattern. The first time the blessing would work and I would see:

Helper available. Sending request: Hi there, helper service. Received response: Hi there, host application!

Quitting SMJobBlessApp and starting it again, without any changes to the code, I would get the dreaded:

Failed to bless helper. Error: Error Domain=CFErrorDomainLaunchd Code=2 “(null)"

Repeating this, running the App, quitting, running it again, the pattern became clear, especially when I used LaunchControl.app to monitor the status of /Library/PrivilegedHelperTools/com.apple.bsd.SMJobBlessHelper:

Status SMJobBlessHelper result SMJobBless() unloaded YES (will load SMJobBlessHelper) loaded NO (will unload SMJobBlessHelper)

So, who's to blame? The docs for SMJobBless() state:

If the job is already installed, success is returned.

My tests seem to indicate otherwise, unless there's something I'm missing.

evanlooij avatar Aug 17 '17 11:08 evanlooij

try launchd unload

0wnrepo avatar Aug 25 '17 11:08 0wnrepo

http://www.stevestreeting.com/2011/11/25/escalating-privileges-on-mac-os-x-securely-and-without-using-deprecated-methods/

0wnrepo avatar Sep 11 '17 12:09 0wnrepo