PDA

View Full Version : Asking for sudo when a program starts (visually)


mitchy_g
November 8th, 2005, 06:04 PM
Hi,
I am wondering how I can ask the user of a program to input the password for 'sudo' when it is needed at startup or whenever. Much like when Synaptic is started from the top menu bar, it brings up a small dialog asking for the password.

Thanks
Mitch :)

23meg
November 8th, 2005, 06:05 PM
Use "gksudo".

mitchy_g
November 9th, 2005, 06:50 AM
23meg,
Thanks for you reply, do you have any idea how to use gksudo from another program in C, im using gtk to create the application.

Thanks Again
Mitch

darth_vector
November 9th, 2005, 08:12 AM
use the

execvp(char* full_path_of_command,char** argument_list)