[Gambas-user] Gambas app run as root

Rob sourceforge-raindog2 at ...94...
Fri Oct 1 22:23:43 CEST 2010


On Friday 01 October 2010 15:27, IMP Technologies - Tajinder Singh wrote:
> I have created a small basic interface for Fedora to change Plymouth
>  theme. But as changing theme requires to run some commands as root, I
>  would like to ask for root password before starting the application.
> Similarly whenever we run 'system-config-boot' or other software that
> requires root privileges.

On any other desktop Linux distribution, either "gksu" or "kdesu" would be 
installed by default, and if you checked the current user (User.id) and it 
weren't zero, you could run one of those programs with the path to your 
program as an argument.  It would prompt the user for his password, and if 
the user had sudo privileges, your program would then be run as root.

As I understand it, Red Hat considers programs like gksu to be a security 
risk, and so it's not available in Fedora.  You could build it yourself and 
include it in the package for your program, I guess.

If sudoers is not set up on your users' systems, gksu has a "--su-mode" 
command line option that should allow you to do the same, but asking for a 
root password.  But most modern distributions don't even set a root 
password anymore, requiring users to do everything with sudo and graphical 
wrappers for it such as gksu.  I don't know what the case is with Fedora.

Rob




More information about the User mailing list