[Gambas-user] Strange problem with running Shell on Fedora (code works in IDE but not in executable!!)

Willy Raets willy at ...2734...
Sat Mar 30 15:18:21 CET 2013


On Sat, 2013-03-30 at 13:14 +0100, Tobias Boege wrote:
> On Sat, 30 Mar 2013, Beno?t Minisini wrote:
> > Le 30/03/2013 12:11, Tobias Boege a ?crit :
> > > On Sat, 30 Mar 2013, Tobias Boege wrote:
> > >> Hmm. I have sudo-1.8.6p7 in use (more accurately, the error comes from the
> > >> 'sudoers' plugin but it has the same version here) on Arch Linux and, as I
> > >> said, my test program works.
> > >>
> > >> Well, I had another look at the source code and it seems that there's a
> > >> certain variable 'def_requiretty' which is zero in my system's package and
> > >> prevents checking /dev/tty at all. This finally explains why all test cases
> > >> worked on my system even though there was no /dev/tty accessible from
> > >> Desktop. See sudoers(5) for a description and how to deactivate this in the
> > >> sudoers configuration.
> > >>
> > >> Since editing user configurations to make programs work is often not
> > >> desirable, I experimented with a patched sudo that requires the tty et
> > >> voila! Got the same error as yours when running from desktop. However, now
> > >> I can't solve it either :-)
> > >>
> > >> I'll start another thread to attract Benoit's attention again...
> > >>
> > >
> > > Hmm, nevermind. You can use the Exec instruction to get it to work:
> > >
> > > hProcess = Exec ["sudo", "-s", "id", "-u" ] For Input Output As "Process"
> > >
> > > This is how the IDE does it and as you mentioned, the IDE gets it correctly.
> > > Maybe someone can enlighten us why it doesn't work with Shell but it's not
> > > that important to me.
> > >
> > > Regards,
> > > Tobi
> > >
> > 
> > SHELL "a b c" ...
> > 
> > is equivalent to:
> > 
> > EXEC [ System.Shell, "-c", "a b c" ]
> > 
> > with a call to setpgid(0,0) to create its own session like an 
> > independant shell.
> > 
> > As for virtual terminal creation, they work both the same.
> > 
> > - "For Input Output" => create a virtual terminal for the i/o of the 
> > child process, and get the i/o of the child process through it.
> > 
> > - "For Read Write" => Just redirect the i/o of the child process to get 
> > them in the parent process.
> > 
> > Can you try to replace "SHELL ..." by "EXEC [ System.Shell, "-c", ... ]" 
> > and tell me if it works better?
> > 
> 
> Exec [System.Shell, "-c", "sudo -s id -u"] For Input Output
> 
> It works!

NOT on the Fedora 17 - LXDE 0.5.12 - Gambas 3.4.0 when run from
executable. Same error again

Screen01.png -> Running executable with error message
Screen02.png -> changed code using Exec [System.Shell .....]

Somehow it is impossible to use sudo on the Fedora box from Gambas
executable.
Although all works when done directly in terminal by hand or when done
from Gambas 3 app run in IDE. The Gambas 3 executables just refuse to
work...

On my Linux Mint 13 all works just fine.


-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen01.png
Type: image/png
Size: 7913 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130330/b2bbe034/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen02.png
Type: image/png
Size: 15874 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130330/b2bbe034/attachment-0001.png>


More information about the User mailing list