[Gtk-sharp-list] Password popup

Michael Hutchinson m.j.hutchinson at gmail.com
Fri Apr 9 18:04:46 EDT 2010


On Wed, Mar 3, 2010 at 3:43 AM, toogooda <andrew at toogoods.co.nz> wrote:
>
> I would like to know what code I use to prompt the user for password so I can
> do admin tasks
>
> ie: I want to create a file in /etc/apt/apt.conf.d at the command line I
> would have to use sudu.
>
> if I open any GUI app in Ubuntu that wants to change settings I get a nice
> box that pops up and asks "enter your password to perform administrative
> tasks"
>
> How is this done in Mono, how is this done and how is that authorization
> used to do the tasks.

That kind of thing is usually done by calling one of the graphical
sudos such as xdg-su/gksu/kdesu/etc, either in your launch script, to
have the whole app run as root, or in subprocesses run by your app, to
prompt for individual actions.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Gtk-sharp-list mailing list