PDA

View Full Version : root-priviliges in application



bkv
24th October 2006, 20:33
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

wysota
27th October 2006, 12:00
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.

bkv
29th October 2006, 19:58
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