QProcess user privilege escalation

Is it possible to start a completely independent process using QProcess with elevated user privileges?

For example, if my C ++ / qt application is running as a limited user, can my C ++ / qt application run another independent process with administrator privileges?

I mean that the administrator username and password are accessible inside the C ++ / qt application that launches the third-party application.

+3
source share
3 answers

In windows, you must create a manifest for your application that defines the privilege level at which it should run. Then you only need to run the application. You will receive a UAC prompt for the new version of Windows. But this is necessary and (IMHO) right. There is no way around this.

Under linux, you must install the sticky bit in your application with the correct user rights for what you want to do during installation.

+1
source

There is no direct way, as far as I know, but you can start using the runas command, since you have a password for the administrator account.

If you do not know the runas command, just enter it in the command shell and it should provide you with all the necessary information.

0
source

, . Linux

( "echo PASS | sudo -u root -S " );

() php, amywhere.

0

All Articles