Prompt for root password

Michael P. Soulier msoulier at digitaltorque.ca
Fri Jan 6 18:09:59 PST 2006


On 1/6/06, JD Arnold <jdarnold at buddydog.org> wrote:
> I'm writing a program that needs to write a file and I'd like to have it
> ask for the root password and run as root, like many of the system config
> applications do.  Do I have to write something special, or is there some
> way to tell KDE (or GNOME) to prompt for the root password? Is this what
> a "setuid" program is?

If it's a graphical program, you can call the gksudo command from
gnome. Or, if you look in its sourcecode, you can find out how it
works and integrate the same into your program.

Mike
--
Michael P. Soulier <msoulier at digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein


More information about the freebsd-questions mailing list