root-priviliges in application
Hi
I am making a kde application with Ruby. The application must run a few system commands that require root-priviliges. How can I best achieve this?
The user should have to enter the password only once, and only if using the part of the program that requires root-priviliges.
Thanks,
Bjorn
Re: root-priviliges in application
I think it is not that easy. You can use KDEsu to get root priviledges for a separate process, but I doubt you can make your process gain priviledges. If you only want external applications to have root access, then simply ask for a password and then use KProcess to run the "su" command passing it the command you want to execute.
Re: root-priviliges in application
Thanks. That seems to work. I use sudo. The new process emitts a signal when it asks for password, and my program can pass along the password previously entered by the user