> >
>
> AFAIK, Desktop.RunAsRoot("whoami") and "xdg-su -c whoami"
> should do exactly
> same thing.
> However only "xdg-su -c whoami" works.
>
> I will investigate...
>
> Jussi
> -
At this moment I'm using another system:
> AFAIK, Desktop.RunAsRoot("whoami") and "xdg-su -c whoami" should do
> exactly same thing.
> However only "xdg-su -c whoami" works.
>
OK, now I understand the problem.
Destop.RunAsRoot() uses internally Exec command, and so redirections
doesn't work.
Instead of Exec there should be Shell..?
Ben
> > But Desktop.RunAsRoot() does something else..?
> ...What do you mean ?
>
AFAIK, Desktop.RunAsRoot("whoami") and "xdg-su -c whoami" should do exactly
same thing.
However only "xdg-su -c whoami" works.
I will investigate...
Jussi
--- Dom 23/9/12, Jussi Lahtinen ha scritto:
> I don't understand...
>
> This works in terminal (so there is nothing wrong with the
> xdg-su script):
> xdg-su -c whoami
>
> Jussi
>
I collect the data (like you know) from the supporting file, and I show those
in TextEdit on Form.
> But Deskto
> I wonder why it works on your system... What it your
> system?
>
> Jussi
> ---
Hello jussi
my system is:
Linux Mint 13 - Maya - Ubuntu 64bit
Kernel=3.2.0-27-generic
[Libraries]
Qt4=libQtCore.so.4.8.1
GTK+=libgtk-x11-2.0
I don't understand...
This works in terminal (so there is nothing wrong with the xdg-su script):
xdg-su -c whoami
But Desktop.RunAsRoot() does something else..?
Jussi
On Sun, Sep 23, 2012 at 8:44 PM, Jussi Lahtinen wrote:
> I tried your code, and I obtain in TextEdit simply the word: r
>
> I tried your code, and I obtain in TextEdit simply the word: root
>
> (But I should be getting: vuott)
>
No. If you run it as root, you should get root!
I wonder why it works on your system... What it your system?
Jussi
Hello Jussi,
>
> I tried your code, and I obtain in TextEdit simply the
> word: root
>
> (But I should be getting: vuott)
>
Oh, I understand that I obtain "root" because I launched that command as "root"
by Desktop.RunAsRoot()
Uhmm... ok.
--
> I tried:
>
> sFile = Temp$()
> Desktop.RunAsRoot("whoami > " & sFile)
>
> Do
> Wait 0.1
> Loop Until Exist(sFile)
>
> fl = Open sFile For Read Watch
>
I tried your code, and I obtain in TextEdit simply the word: root
(But I should be getting: vuott)
--
In the meantime, I
I tried:
sFile = Temp$()
Desktop.RunAsRoot("whoami > " & sFile)
Do
Wait 0.1
Loop Until Exist(sFile)
fl = Open sFile For Read Watch
But I can only get:
Try `whoami --help' for more information.
Same command works in terminal:
whoami > /tmp/gambas.1000/2413/6.tmp
So, I'm not sure what
> --- Dom 23/9/12, Jussi Lahtinen ha scritto:
>
> This is good idea, but instead of "/tmp/a", I would use
> Temp$():
>
> Private fl As File
> Private sFile As String
>
> Public Sub Form_Open()
>
> sFile = Temp$()
> Desktop.RunAsRoot("cat /dev/ttyUSB1 > " & sFile)
>
> fl = Open sFile For R
> Private fl As File
>
>
> Public Sub Form_Open()
>
> Desktop.RunAsRoot("cat /dev/ttyUSB1 > /tmp/a")
>
> fl = Open "/tmp/a" For Read Watch
>
> End
>
>
> Public Sub File_Read()
>
> Dim s As String
>
>s = File.Load("/tmp/a")
>
>TextEdit1.Text = s
>
> End
>
This is good idea, but instead
> > i 've seen in other postingsyou mentioned tests using
> > "Desktop.RunAsRoot("whoami")"
> > Can you provide a working example how to use
> Desktop.RunAsRoot, please ?
> > (e.g. how to get the returned usersname)
Hello Wally,
you could use a supporting file, and then you could read in it...
I
Oh, yes, that was the reason I haven't use it!
It doesn't have method to return value.
So far I have used gksudo with shell command, but generally working
solution is needed.
Jussi
On Sun, Sep 23, 2012 at 11:10 AM, wally wrote:
> Hello Jussi,
>
> i 've seen in other postingsyou mentioned tes
>
> ...but Ihad a problem:
> I tried function Desktop.RunAsRoot(), but I heve got this
> notice:
>
> /tmp/gambas.1000/3328/xdg-utils/xdg-su: 361:
> /tmp/gambas.1000/3328/xdg-utils/xdg-su: xterm: not found
>
Opss, I didn't have "xterm" program installed in my system ! :-D
Now I installed
uot;$user"
and so it worked.
But it's possible to use this simple command line in code Gambas:
Shell "/usr/bin/x-terminal-emulator -e su -c \"here_the_entire_command\"
\"$user\""
it substitutes Desktop.RunAsRoot() function.
regards
Vuott
--- Dom
Hello Jussi,
i 've seen in other postingsyou mentioned tests using
"Desktop.RunAsRoot("whoami")"
Can you provide a working example how to use Desktop.RunAsRoot, please ?
(e.g. how to get the returned usersname)
thx wally
--
> Mmm... No. By looking at the xdg-utils source code, I don't think that
> Desktop.RunAsRoot() does anything useful. It should be removed or
> rewritten differently...
>
RunAsRoot() method runs command as root, not the whole program, as I
understand was the goal.
It still have problems? What do y
Le 22/09/2012 14:32, Benoît Minisini a écrit :
> Le 22/09/2012 14:26, Jussi Lahtinen a écrit :
>> Thinking this bit more... I think it would be very difficult to safely
>> enable IDE to run projects as root!
>> So, use virtual machine, there you can mess all you want without problems
>> (as long as
Le 22/09/2012 14:26, Jussi Lahtinen a écrit :
> Thinking this bit more... I think it would be very difficult to safely
> enable IDE to run projects as root!
> So, use virtual machine, there you can mess all you want without problems
> (as long as you back up sources outside of the virtual machine).
Thinking this bit more... I think it would be very difficult to safely
enable IDE to run projects as root!
So, use virtual machine, there you can mess all you want without problems
(as long as you back up sources outside of the virtual machine).
Jussi
On Sat, Sep 22, 2012 at 3:20 PM, Jussi Laht
You mean your program is intended to run always as root?
Maybe you then need new feature to IDE... or setup virtual machine and
there start IDE as root.
Jussi
On Sat, Sep 22, 2012 at 2:13 PM, wally wrote:
> Jussi,
>
> but this is not very convnient during development
>
> wally
>
>
>
> --
Jussi,
but this is not very convnient during development
wally
--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http:/
I think this would require new option to IDE.
But you can make your project to use graphical sudo, and ask password
independently of IDE.
Jussi
On Sat, Sep 22, 2012 at 8:58 AM, wally wrote:
> Hello,
>
> (how) can i run a project as root from within gambas3 IDE running as user ?
>
> thx wally
Hello,
(how) can i run a project as root from within gambas3 IDE running as user ?
thx wally
--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is
25 matches
Mail list logo