QProcess as another user?
-
I am working on a application that will build a linux cross platform multilib toolchain. The first part of the application does some prep and needs to be run with root privileges. Everything after needs to be ran from a crippled user account. My question is how would I run a QProcess as another user?
Thanks Zester.
-
Noooo I can't use kdesudo that would make my Qt only project a Kde project and suck in about a million dependences. I did however try setuid() and getuid() but it turns out there disabled in most distro's for security reasons. And I also did some digging threw kdesudo's and it's dependences source code. But it wasn't at all obvious to me as to how they were accomplishing the samething. In kdesudo's configure file it does check for /usr/bin/sudo
-
Checkout out http://doc.qt.nokia.com/4.7/qprocess.html#setupChildProcess .
-
Thank you that is exactly what I was looking for. Can't beleve that I didn't see that before! Hmmm Thanks again.
[quote author="unclewerner" date="1297353342"]Checkout out http://doc.qt.nokia.com/4.7/qprocess.html#setupChildProcess .[/quote]