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

Tobias Boege taboege at ...626...
Sat Mar 30 12:11:36 CET 2013


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




More information about the User mailing list