[Gambas-user] Executing commands as root

Stefano Palmeri rospolosco at ...152...
Wed Aug 5 17:07:26 CEST 2009


Il mercoledì 5 agosto 2009 15:45:24 David Villalobos Cambronero ha scritto:
> Hi all,
>
> Time ago, someone asked about executing commands as root and pass the root
> password to SHELL, does anybody remember the solution?
>
>  Regards
>
>
> --
> David
>
>

He was me. My error was I opened the shell process 
FOR READ WRITE instead of INPUT OUTPUT. 
I attache a little example so it will be clear howto.
The example is a form with a textbox. You type
the root password and confirm and you execute
cat /etc/sudoers as root (you'll see the output on Gambas
console). It's just an example, you can try any other root command.
Other solutions includes using gtksu or kdesu, but this way you
depend on desktop.

Ciao,

Stefano

>
>
> ---------------------------------------------------------------------------
>--- Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day trial. Simplify your report design, integration and deployment - and
> focus on what you do best, core application coding. Discover what's new
> with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


-------------- next part --------------
A non-text attachment was scrubbed...
Name: su-0.0.2.tar.gz
Type: application/x-tgz
Size: 8011 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090805/47518163/attachment.bin>


More information about the User mailing list