Sudo make install in build steps



  • Hello to all.
    I would like to do "make install" in qt as a sudo.
    But I don't know how to do that as a sudo.

    In "project-build step" I can chose "install" but not as a sudo.
    Any ideas?

    Thanks a lot.


  • Moderators

    @AlvaroS I'm not sure whether it is possible as you need to enter your root password.
    Why do you want to do it while developing?


  • Moderators

    @AlvaroS You would have to have a process that could execute your install running as root already. I usually have a helper process running as root when I have apps that need root permissions. Then I use an interface; named pipes, shared memory, socket, whatever to communicate with the process and have it do the tasks I need done as root. You should limit what the process is allowed to do though so people don't run any sort of hacks against your app.

    Or you could run a shell script that ran sudo for you, but it would pop up a terminal and prompt the user for their password.

    And finally, you can whitelist your process for root/sudo access without a password. Note, this is a super bad idea and very dangerous. If you are in a multiuser environment expect to get hacked if you do this. ;)


Log in to reply
 

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