I have a Qt GUI application that must be ran as sudo. Right now, I have a script that they are supposed to execute to start program as sudo which adds an argument that I check to make sure they launched from the script.
This technique works, but it doesn't really check if sudo, it only checks that script launched it.
Any thoughts on doing a more precise sudo test?
I would use getuid or geteuid.
Here is a previously answered question similar to yours.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With