Re: [Gambas-user] Gambas app run as root

2010-10-05 Thread Jose J. Rodriguez
On 10/1/10, IMP Technologies - Tajinder Singh wrote: > > I have created a small basic interface for Fedora to change Plymouth theme. > But as changing theme requires to run some commands as root, I would like to > ask for root password before starting the application. > Similarly whenever we r

Re: [Gambas-user] Gambas app run as root

2010-10-05 Thread Jussi Lahtinen
OK. 1. su doesn't work with Ubuntu because root account is disabled by default! 2. "sudo -k" doesn't seem to be able kill timestamp correctly. So, when I open new terminal and try to get root without password, it doesn't work. 3 This program actually works IF it is run under gdb or valgrind!!? J

Re: [Gambas-user] Gambas app run as root

2010-10-05 Thread Jussi Lahtinen
I recompiled Gambas2 and it still doesn't work. So, I run this project with gdb and I find something very worrying. I edited that project so that line; *hProcess = SHELL "su -c 'ls /root'" FOR INPUT OUTPUT* is now: *hProcess = SHELL "sudo whoami" FOR INPUT OUTPUT* ~/Desktop/su$ gbc2 -agpmt ~/Desk

Re: [Gambas-user] Gambas app run as root

2010-10-05 Thread M. Cs.
1. Open your project 2. Add a new module, let's say "Sudo" 3. Paste these lines in: ' Gambas class file PUBLIC wins AS Form PUBLIC black AS Button PUBLIC szoveg1 AS TextBox PUBLIC hProcess AS Process PUBLIC SUB ReadPassword() DIM black AS Button DIM labi, labi2 AS Label wins = NEW Form wins.Width

Re: [Gambas-user] Gambas app run as root

2010-10-04 Thread Benoît Minisini
> OK, here it is. > > Jussi > > Well, your little example works as expected there (Mandriva 2010.1 / x86-64). On Gambas 3, it works if you add 'As "Process"' after the SHELL instruction and replace LINE INPUT by the READ instruction. Note that you should use EXEC instead of SHELL. Not import

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Jussi Lahtinen
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 privilege

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Jussi Lahtinen
OK, here it is. Jussi 2010/10/3 Benoît Minisini > > It is attached to first mail from Stefano. > > > > Jussi > > > > I didn't receive the first mail from Stefano, strange... > > -- > Benoît Minisini > > > -- > Virtuali

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Benoît Minisini
> It is attached to first mail from Stefano. > > Jussi > I didn't receive the first mail from Stefano, strange... -- Benoît Minisini -- Virtualization is moving to the mainstream and overtaking non-virtualized environ

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread EA7DFH
El 03/10/10 19:21, Jussi Lahtinen escribió: > It is attached to first mail from Stefano. > > Jussi > > > 2010/10/3 Benoît Minisini > >>> Il domenica 3 ottobre 2010 18:46:38 Jussi Lahtinen ha scritto: No, with Ubuntu 10.04 it does not work. Textbox.Text is "", because shell is execute

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Jussi Lahtinen
It is attached to first mail from Stefano. Jussi 2010/10/3 Benoît Minisini > > Il domenica 3 ottobre 2010 18:46:38 Jussi Lahtinen ha scritto: > > > No, with Ubuntu 10.04 it does not work. > > > Textbox.Text is "", because shell is executed before textbox is even > > > shown. > > > > > > Your o

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Benoît Minisini
> Il domenica 3 ottobre 2010 18:46:38 Jussi Lahtinen ha scritto: > > No, with Ubuntu 10.04 it does not work. > > Textbox.Text is "", because shell is executed before textbox is even > > shown. > > > > Your original code gives result: > > *Password: > > Password: > > su: Authentication failure* > >

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Stefano Palmeri
Il domenica 3 ottobre 2010 18:46:38 Jussi Lahtinen ha scritto: > No, with Ubuntu 10.04 it does not work. > Textbox.Text is "", because shell is executed before textbox is even shown. > > Your original code gives result: > *Password: > Password: > su: Authentication failure* > Then form appears, and

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Jussi Lahtinen
No, with Ubuntu 10.04 it does not work. Textbox.Text is "", because shell is executed before textbox is even shown. Your original code gives result: *Password: Password: su: Authentication failure* Then form appears, and after that when write password and click "confirm", you will get error messag

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Benoît Minisini
> Il domenica 3 ottobre 2010 15:04:15 Jussi Lahtinen ha scritto: > > I looked your example just for interest. > > It doesn't seem to work with Ubuntu 10.04 64bit. > > > > There are two issues, maybe something with my system... > > This is first time I used "*su*" (normally I use sudo) on this comp

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Stefano Palmeri
Il domenica 3 ottobre 2010 15:04:15 Jussi Lahtinen ha scritto: > I looked your example just for interest. > It doesn't seem to work with Ubuntu 10.04 64bit. > > There are two issues, maybe something with my system... > This is first time I used "*su*" (normally I use sudo) on this computer, > and i

Re: [Gambas-user] Gambas app run as root

2010-10-03 Thread Jussi Lahtinen
I looked your example just for interest. It doesn't seem to work with Ubuntu 10.04 64bit. There are two issues, maybe something with my system... This is first time I used "*su*" (normally I use sudo) on this computer, and it doesn't work... *su -c 'whoami'* gives; *su: Authentication failure* Ho

Re: [Gambas-user] Gambas app run as root

2010-10-02 Thread Stefano Palmeri
Il venerdì 1 ottobre 2010 21:27:39 IMP Technologies - Tajinder Singh ha scritto: > Hi all, > > I am new to Gambas but have done some projects in Visual Basic at college > time. > > It is a good feeling to know about Gambas which I can use to create helpful > applications on Linux platforms. > > I

Re: [Gambas-user] Gambas app run as root

2010-10-01 Thread Rob
On Friday 01 October 2010 15:27, IMP Technologies - Tajinder Singh wrote: > I have created a small basic interface for Fedora to change Plymouth > theme. But as changing theme requires to run some commands as root, I > would like to ask for root password before starting the application. > Similar

[Gambas-user] Gambas app run as root

2010-10-01 Thread IMP Technologies - Tajinder Singh
Hi all, I am new to Gambas but have done some projects in Visual Basic at college time. It is a good feeling to know about Gambas which I can use to create helpful applications on Linux platforms. I have created a small basic interface for Fedora to change Plymouth theme. But as changing theme r