Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QProcess user privilege elevation

Tags:

qt

qt4

Is it possible to start a fully independant process with QProcess with elevated user privilleges?

For example if my c++/qt application is run as a limited user, can my c++/qt application start another independant process with admin rights?

I am implying that the admin username and password is available inside the c++/qt application that is doing the launching of the 3rd party application.

like image 258
user440297 Avatar asked Aug 13 '26 14:08

user440297


1 Answers

In windows you should create a manifest for your application that specifies the privilege level it needs to run in. Then all you have to do is start the application. You will get a UAC prompt on newer windows version. But that is required and (IMHO) correct. There is no way of going around this.

Under linux you should on installation set a sticky bit to your application with the correct user-rights for what you want to do.

like image 137
RedX Avatar answered Aug 15 '26 21:08

RedX