lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

22269571: SMJobBless sample code does not work on 10.11b6 #5280

Open openradar-mirror opened 9 years ago

openradar-mirror commented 9 years ago

Description

Summary: As part of investigating an issue in GitHub Desktop on El Cap, I ran the SMJobBless sample code:

https://developer.apple.com/library/prerelease/mac/samplecode/SMJobBless/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010071

Unfortunately, it doesn’t actually work. After authorizing with the correct credentials, it simply errors out:

2015-08-13 12:20:36.557 SMJobBlessApp[1102:440592] Something went wrong! CFErrorDomainLaunchd / 4

Steps to Reproduce:

  1. Download the SMJobBless sample code at the above URL.
  2. Open SMJobBless.xcodeproj in Xcode 7.
  3. Build and run. (No code changes are required at time of writing.)
  4. When prompted by the running app, enter administrator credentials to allow the app to install a helper tool.

Expected Results: I expected it to bless & launch the app correctly.

Actual Results: It failed:

2015-08-13 12:20:36.557 SMJobBlessApp[1102:440592] Something went wrong! CFErrorDomainLaunchd / 4

Regression: This worked correctly on 10.10 AFAIK.

Notes: SMJobBless appears to be going away, going by the removal of the Swift bridging of ServiceManagement:

https://developer.apple.com/library/prerelease/mac/releasenotes/General/APIDiffsMacOSX10_11/Swift/ServiceManagement.html

We use Objective-C to call SMJobBless, but it’s unclear what this means for us given that we need to support 10.9+ right now, and our current use of SMJobBless is crashing under 10.11b6.

We think we have a workaround, further details to follow.

Product Version: Xcode-beta (7A176x) Created: 2015-08-13T16:28:39.135750 Originated: 2015-08-13T12:28:00 Open Radar Link: http://www.openradar.me/22269571

joosth9n commented 9 years ago

Verified, same problem here. OSX 10.11 Beta (15A243d), Xcode 7.0 beta 3 (7A152u)

0wnrepo commented 7 years ago

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