Show Fedora 17 Gnome authentication dialog
I want to execute a terminal command that requires root privileges through QProcess or the system() function. For example:
- QProcess process;
- process.start("su -c \"cp -f -r /home/<user>/file.txt /etc\"");
- while( process.waitForFinished());
… or …:
- system("su -c \"cp -f -r /home/<user>/file.txt /etc\"");
“su” is a command-line interface command for providing root privileges. I want to use a “gksu”, “kdesu”, “beesu” – a GUI equivalent of the command-line interface in Fedora 17 Gnome to ask the user for the root’s password.
I know that “beesu” could be installed additionally and thus provide the desired GUI interface, but it should be installed additionally. I want to use a GUI password authentication dialog that comes in Fedora 17 Gnome by default.
When you install packages through the “Add/Remove Software” tool in Fedora, it asks you for the administrator/root password through a GUI interface:
This is the interface I want to use and call. Is this interface integrated in the “Add/Remove Software” tool or is it a separate program that can be called by any other program?