View Single Post
Posts: 152 | Thanked: 41 times | Joined on Dec 2009 @ Sydney
#79
Originally Posted by YoDude View Post
Can an xTerm script @root be tied to a desktop shortcut like this command was >> http://talk.maemo.org/showpost.php?p=409122&postcount=3


Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=POW
Exec=sudo gainroot
Exec=echo 118 > /sys/class/i2c-adapter/i2c-2/2-0063/power_level
Icon=     
#X-Window-Icon=timerwidget
X-Window-Icon=     
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
would even work and I would have to run back and forth to my car where my only FM radio lives...

...in the dark, on a cold rainy night. Brrrrr!


I am not familiar with the Desktop files that much, so not sure how having to Exec lines works. Is that right?

And as sudo gainroot launches a login shell, any subsequent commands shouldn't run in there, atleast in a shell script it doesn't, again, not familiar with desktop files.
So one could setuid bit on a script that just runs this command, so it runs with root privileges.

Ok I just read your linked thread. That is a command running as normal user. So it gets tricky to escalate privileges in a command.

The setuid is the best I can think of for now, but people will complain it is not a secure option

I need to take a look at that this "gainroot" argument actually does; we might be able to add this command to the suders file so we can simply sudo the command without the need for a password....