Using SMJobBless to execute commands with elevated privileges on Mac OS X



  • Is there a live example which describes the proper way to integrate:
    https://github.com/atnan/SMJobBlessXPC

    in 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?



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.