Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Sudo Qt Application on OS X from the created DMG

    General and Desktop
    macdeployqt mac sudo cocoasudo
    1
    1
    651
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      blues-man last edited by

      Hi,
      I would like to find out the most suitable way in order to deliver a Qt Application on OS X that requires root privileges. I'm using macdeployqt tool that let me resolve all dependencies and ship everything in a DMG, but I need to sudo the Qt binary to open some privileged port (<1024) thus I need to ask the user password before executing it.
      Right now, I'm just calling Cocoasudo binary from a C program that makes:

      execlp("./cocoasudo", "cocoasudo", "./qtbinary");

      this binary is called modifying Info.plist Application file, thus the Application ask for user password and cocoasudo does it job, but I wonder if there is another more standard way in order to do this without this tricky mode. Maybe integrating directly Cocoasudo code inside the Qt Project, but how to run grant the program from Qt main loop?

      Thanks

      1 Reply Last reply Reply Quote 0
      • First post
        Last post