On Thu, 24 May 2001, Morelli Enrico wrote:
> I should execute a command under Linux like root from a PyGtk application.
> If I use sudo, it ask for the root password under shell, instead I want
> that the password should ask from an application window.
Well, actually, sudo does _not_ ask you for root's password; it asks you
for _your_ (well, the user calling sudo's) password. This makes quite a
difference, because:
- sudo must be setuid root. If you want to provide the same functionality,
your application must also be setuid root. Knowing the state of pygtk and
gtk security and stability together, I don't know if this is such a hot
idea.
(Note that this isn't being critical of pygtk at all -- James kicks ass :-)
> Is it poosible to open a window to ask root password and so execute a
> command like root?
If you wish to ask just for the root password, you _can_ do:
a) ask for the password, authenticate it against passwd, shadow, nis,
whatever. This means doing auth yourself, and supporting the necessary
auth.
b) ask for the password, and pass it along to something that does the
authentication + execution for you -- doing an exec of 'su -c' could be an
idea.
These ideas probably have many security `features' of their own. To be
short, it's complicated, potentially insecure, and possibly dangerous. Are
you sure you want to do it?
Take care,
--
/\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil
~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk