atnan / SMJobBlessXPC

Apple's SMJobBless sample code, modified to use XPC for app/helper IPC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to bless helper in OS X 10.10 (CFErrorDomainLaunchd - error 4 = kSMErrorAuthorizationFailure)

evands opened this issue · comments

My own app stopped being able to install its helper in OS X 10.10 in the final release, though I believe this was working in earlier beta versions. I came across SMJobBlessXPC as an excellent reduction test case... and found the same problem.

After duly authorizing with an admin password, SMJobBless() results in:
Failed to bless helper. Error: Error Domain=CFErrorDomainLaunchd Code=4 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 4.)"

Error 4 is kSMErrorAuthorizationFailure. The same code was working prior to 10.10 in my testing.

One user reports to me that he noticed the symptoms of the bug in 10.9.5 but not in prior minor releases of 10.9; I can't confirm that at the moment.

FYI: I've submitted radar://18703894 on this issue

Thanks for the helpful reply.

The ever-excellent Quinn "the Eskimo" with Apple technical support provided me the solution. I'll quote the relevant parts of his reply to aid others who may run into the same problem:

In most cases this is caused by a problem with your code signing setup (which is tricky to get right when using SMJobBless). Please try the following:

  1. Download the SMJobBless sample code.
    https://developer.apple.com/library/mac/samplecode/SMJobBless/
  2. Use the SMJobBlessUtil tool within that sample to check your built binary.
$ cd ~/Downloads/SMJobBless
$ ./SMJobBlessUtil.py check /path/to/your.app
               *                   *                   *

Just by way of reference, I tested SMJobBless on 10.10 and it seems to work as expected. Specifically, I did this:

  1. I downloaded and built the SMJobBless sample code.
  2. I used SMJobBlessUtil to set up the code signing.
$ cd ~/Downloads/SMJobBless
$ ./SMJobBlessUtil.py setreq \
    build/Debug/SMJobBlessApp.app \
    SMJobBlessApp/SMJobBlessApp-Info.plist \
    SMJobBlessHelper/SMJobBlessHelper-Info.plist
  1. I rebuilt the app.
  2. Running it on 10.10, it worked as expected.

I am having a same issue while I tried to install helper tool using SMJobBless. I have also tried the solution you have posted but it prints "build/Debug/SMJobBlessApp.app: app not found". Do you have any idea about this?

You probably aren't storing the built product in a 'build' folder beneath the checkout. Replace that with the path to the actual built product. The easiest way I know of to find it is to right-click on the product in the 'Products' group in Xcode and select 'Reveal in Finder'.

commented

screenshot 2015-04-24 16 45 22

screenshot 2015-04-24 16 53 36

I find it curious that someone who advertises a company in their sig-line, would be so presumptuous and basically rude to any person seeking assistance. Knowing nothing else about said company, I can assure you that, based on this one thread, I'd never resort to using them. I'd be more likely to leave the tech field altogether, rather than have to do business with them, ever.

Just my $0.02, but that's the way I am currently feeling about it.

@evands - I'm glad you solved your problem. Thanks for sharing the answer, as I was experiencing the same issue.

@RudyAramayo - Thank you for nothing, which is the value you provided here. I believe I know what your problem is as well, but unfortunately, it is not technical in nature. Good luck in your future endeavors.

commented

Hey Rudy,

It’s refreshing to be proven correct about the nature of your issue. Because I’ve recently discovered a tiny amount of fondness for you (probably brought about by the way you deleted your original posts before responding,) I’m going to try to help you with that problem right here, in this email.

I thought my assessment of your 2 posts was spot on. You can probably go a long way in this world without my help, but for all you know, I might be your current CTO. Or, I may be your next customer. Or in a position to hurt or help your career at some future point.

I’ve learned a lot of lessons in my career in IT. The most important one that I’d like to share with you right now, is “Don’t shit where you eat.”

You act like an immature, testosterone-laden hotshot (maybe), who hasn’t yet learned how to not to behave like a douchebag in public venues.
Or that all actions have consequences.

If I were you, I’d try to get those lessons under your belt sooner, rather than later. You’ll likely find your path through life will be smoother and more secure without an array of brightly burning bridges in your wake.

Cheers!

On 04/24/15, at 14:58 , RudyAramayo notifications@github.com wrote:

Wow, said the guy with no contributions. Too old to code I suppose. Watch out cause here comes the next wave of tech to deprecate you.


Reply to this email directly or view it on GitHub #7 (comment).

commented

Not at all, but thanks for checking!

On 04/24/15, at 18:07 , RudyAramayo notifications@github.com wrote:

You mad bro?


Reply to this email directly or view it on GitHub #7 (comment).

@MrWonderful Glad it was helpful! I love your turn of phrase: "an array of brightly burning bridges in your wake." @RudyAramayo of OrbitusRobotics LLC is certainly an expert at the sort of social arson that only a troll brandishing a flaming torch can achieve.

You guys are right, sorry guys... I should be nicer. Just don't have any time thats all...

-Peace