How to use BetterAuthorizationSample? - Cocoa

I'm trying to use BetterAuthorizationSample, and then move on to the so-called "malicious" way of using setuid to gain root privileges.

I am currently using AuthorizationCreate (); with BLAuthentication to have root access to modify some files, but I'm somewhat annoyed by the fact that I have to constantly enter my password every time I start the application.

So, I came across an Apple HelperTool method, and I just can't figure it out.

I've been working with Cocoa for a couple of months now, but it's just out of reach, but I still need to. How to implement this tool to perform simple privileged root tasks?

Is there an easier way to use the HelperTool concept so that my users can just enter the password once and grant root privileges forever?

+5
source share
1 answer

The “modern” way to make a helper tool on Mac OS X is to submit it as part of your application, and use the structure ServiceManagementto deploy it . Your users enter their password once, when deploying the tool. This sets it up as a task launchd; From now on, you use any on-demand launch mechanism to launch the assistant and make it work for you.

, , , . , , " ", AuthorizationRightSet(), , , .

GitHub ServiceManagement .

+2

All Articles