Using SMJobBless to execute commands with elevated privileges on Mac OS X
-
wrote on 9 Nov 2012, 14:12 last edited by
Is there a live example which describes the proper way to integrate:
https://github.com/atnan/SMJobBlessXPCin an existing Qt application project?
From Mac OS X 10.7 onwards writing to /Library/Application Support/... needs elevated privileges.
As far as I know using SMJobBless in an application is the most proper way to execute commands with elevated privileges on Mac OS X. This means that the application that should execute such commands should install a privileged helper tool in /Library/PrivilegedHelperTools and when the source application wants to execute a command with elevated privileges, it should first install the helper tool and communicate with it the commands to be executed.
Is there any written walkthrough about how to incorporate the privileged helper tool technique in Qt application project?
-
wrote on 23 Apr 2016, 23:08 last edited by
I have create a project in Qt to show how to sign, install an execute a privileged helper tool by using SMJobBless; you can see the code here: https://github.com/mbsanchez/QtPrivilegedHelperExample
I have created it, because there is not documentation on how to install a privileged helper tool, developed with C++ on QtCreator. Other projects are developed using xcode, however my code is developed completely in C++ using QtCreator.
qmake is used to alter the plist files, and sign the executables and app bundle.