Questions tagged [smjobbless]

SMJobBless demonstrates how to securely install a helper tool that performs a privileged operation and how to associate the tool with an application that invokes it.

SMJobBless demonstrates how to securely install a helper tool that performs a privileged operation and how to associate the tool with an application that invokes it.

SMJobBless uses ServiceManagement.framework that was introduced in Mac OS X v10.6 Snow Leopard.

As of Snow Leopard, this is the preferred method of managing privilege escalation on Mac OS X and should be used instead of earlier approaches such as BetterAuthorizationSample or directly calling AuthorizationExecuteWithPrivileges.

21 questions
10
votes
2 answers

SMJobBless failed with CFErrorDomainLaunchd Code 9

Does anybody know what does that error code mean? I get SMJobBless error with this return code value. Failed to bless helper: Error Domain=CFErrorDomainLaunchd Code=9 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 9.)" I googled,…
andrey.s
  • 789
  • 10
  • 28
9
votes
3 answers

Gain administration privileges with swift for a Mac Application

I am writing a pice of software that needs to often run a command with root privileges. Right now, I am doing this by asking the user for their password once, saving it and then providing that password to NSAppleScript as an argument along with with…
Cripto
  • 3,581
  • 7
  • 41
  • 65
4
votes
1 answer

SMJobBless works only with kSMDomainSystemLaunchd, need kSMDomainUserLaunchd

The documentations states, that with SMJobBless you can use only kSMDomainSystemLaunchd SMJobBless(kSMDomainSystemLaunchd, (CFStringRef)label, authRef, (CFErrorRef *)error); But how to create a LaunchAgent inside LaunchAgents/ in users library,…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
3
votes
1 answer

SMJobBless.py script doesn't work on M1 Macs

The SMJobBlessUtil.py script (which Apple provides for setting/checking the pairing between a privileged helper tool and its main app) does not work on M1 Macs. $ ./SMJobBlessUtil.py check…
Alexander
  • 59,041
  • 12
  • 98
  • 151
3
votes
4 answers

Uninstalling items installed by an .app when user deletes it, including SMJobBless helpers

The short version: is it possible to delete helper tools which were set up by the app (SMJobBless() etc.) when the app is deleted? If so, how? The long version: The Mac app we are developing unfortunately requires admin privileges to perform an…
pmdj
  • 22,018
  • 3
  • 52
  • 103
3
votes
1 answer

OS X - Truly 'On Demand' Privileged Helper Tool

My application needs to write files to restricted places on the filesystem. To do so, I use a helper tool that is run as root. Everything is working correctly, following this example, my helper tool is correctly installed and run. I use this…
Vince
  • 525
  • 1
  • 3
  • 19
3
votes
2 answers

Sandboxed app with Helper app

I'm trying to execute helper app from sandboxed application, but its throwing error errAuthorizationDenied (-60005), I'm using Apple SMJobBless as example. Currently I have this var authItem: AuthorizationItem = AuthorizationItem(name:…
Claw
  • 317
  • 4
  • 13
3
votes
1 answer

SMJobBless is for Privileged Helper tool, but what if I want to have launchd plist to get copied to /Users//Library/LaunchAgents

SMJobBless is for Privileged Helper tool, but what should I do if I want to have launchd plist to get copied to /Users//Library/LaunchAgents. I do not want to enter any user password to install the helper tool.
a k
  • 531
  • 5
  • 15
2
votes
2 answers

How to embed info.plist in privileged helper for SMJobBless?

I try to make helper tool for my app with SMJobBless; when I following the settings with passage : http://www.tanhao.me/pieces/1623.html/ when I run ,xcode gives me : SMJobBless Failed, error : Error Domain=CFErrorDomainLaunchd Code=8 "(null)" 8…
Shu Shu
  • 95
  • 9
2
votes
2 answers

Understanding Priviledged Helper Tools in OSX

I need at some point in my application an elevated operation. For this I found apples SMJobBless mechanism. I have written a simple helper tool and install it via SMJobBless. So far this works. But what I do not understand right now: How do I start…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
2
votes
4 answers

SMJobBless gives error CFErrorDomainLaunchd Code=8

I am trying to install a helper tool via SMJobBless and I am getting the following error, Error Domain=CFErrorDomainLaunchd Code=8 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 8.) I verified the code sign, plist of application…
Priya Raj
  • 71
  • 1
  • 5
1
vote
1 answer

SMJobKit (SMJobBless) BadBundleCodeSigning

I’m trying to execute privileged helper trough SMJobBless with help of SMJobKit framework, but when I try to install the service, this error is thrown Error Domain=SMJobKit.SMJError Code=4 "(null)" And when I run function checkForProblems it throws…
Dellar
  • 41
  • 4
1
vote
1 answer

Apple's SMJobBless() doesn't work under sandbox

Apple's SMJobBless is supposed to be the new, correct way to write a program that runs in the sandbox and requires privileges. However, when I downloaded the code and turned on the Sandbox, it doesn't work. Instead I get this error: 2015-09-27…
vy32
  • 28,461
  • 37
  • 122
  • 246
1
vote
1 answer

Asking for admin privileges for only standard accounts

I am moving some files to /Applications directory by my application and using SMJobBless() for Elevating to admin rights privileges. But it prompts for admin credentials for any type of account- admin or standard_user, can we put a check and ask for…
1
vote
1 answer

Using common privilege helper tool across workspace- SMJobBless

I have a workspace which has 2 projects, one is installer application and other is uninstaller app. Both the apps requires privilege helper tool for some operations. I am trying to write a common tool as a third project in my workspace that would be…
john fedric
  • 167
  • 1
  • 11
1
2