July 13, 2012

napajejenunedk0 napajejenune..
Ant Farmer
158 posts

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:

  1. QProcess process;
  2. process.start("su -c \"cp -f -r /home/<user>/file.txt /etc\"");
  3. while( process.waitForFinished());

… or …:

  1. 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:
http://dox.bg/files/dw?a=c6fa01baa9

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?

Regards

1 reply

July 16, 2012

Josué V. Herrera Josué V. Herrera
Lab Rat
41 posts

Hi,

I believe this is what you’re looking for: How to get applications running with root privileges [qt-project.org]

 
  ‹‹ itemview (insert in modal)      Remove Borders around a QLabel ››

You must log in to post a reply. Not a member yet? Register here!