[Gambas-user] Gambas app run as root

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Oct 3 21:46:22 CEST 2010


Works as excepted, no surprises here.
Problem is how to make shell wait for input.

Jussi


Please, try the following code and tell us if it works for you:
>
>
> PRIVATE $hprocess AS Process
>
> PUBLIC SUB Form_Open()
> DIM pwd AS String
>
> pwd = InputBox("Type your root password", "Root privileges needed")
>  IF pwd THEN
>    $hprocess = SHELL Subst("echo &1 | sudo -S ls /root", pwd) FOR READ
>  ELSE
>    RETURN
>  ENDIF
> END
>
> PUBLIC SUB Process_Read()
> DIM outstr AS String
>
>  WHILE NOT Eof($hprocess)
>    LINE INPUT #$hprocess, outstr
>    PRINT outstr
>  WEND
>
> END
>
> The only drawback is that passwords in the inputbox are not hidden.
>
> Regards,
>
>
> --
> Jesus, EA7DFH
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list