Is there a way to run the cocoa application as root but show ui?

The helper tool requires communication with the application.

So I want to know how an application can have root permissions.

Answered by john daniel in 305723022

Hello yurim0512,

It's complicated. I can't do anything more than point you to this URL: developer.apple.com/library/content/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html


And to get technical, that isn't even a URL becaue posting any URLs here in the forum will kill your post.

Accepted Answer

Hello yurim0512,

It's complicated. I can't do anything more than point you to this URL: developer.apple.com/library/content/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html


And to get technical, that isn't even a URL becaue posting any URLs here in the forum will kill your post.

Is there a way to run the cocoa application as root but show ui?

I strongly recommend against trying to do that. It may work, or seem like it works, in specific circumstances but there are likely to be lots of problems, both with security vulnerabilities and binary compatibility.

The recommended approach is to break the minimal amount of code that requires privileges into a privileged helper tool and have your app communicate with that via IPC. How you do that really depends on your specific circumstances. You wrote:

The helper tool requires communication with the application.

which isn’t a lot of detail. Please elaborate.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Is there a way to run the cocoa application as root but show ui?
 
 
Q