You are not logged in.

#1 2010-06-04 17:41:05

Barghest
Member
From: Hanau/Germany
Registered: 2008-01-03
Posts: 563

[solved] sudo not granting full root privileges?

Hi,

when I'm trying to set the thresholds for starting and stopping battery charging with Tp_smapi using sudo receive the message that I don't have the permission to do that.

$ sudo echo 85 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
bash: /sys/devices/platform/smapi/BAT0/stop_charge_thresh: Keine Berechtigung

But when I

$ su -
Passwort: 
# echo 85 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh

everything works fine. I always thougt with sudo you can do everything root can do. So, this isn't the case?

Thanks for enlighten me smile

Barghest

Last edited by Barghest (2010-06-04 17:48:39)

Offline

#2 2010-06-04 17:42:38

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [solved] sudo not granting full root privileges?

actually sudo echo 85 > /something are two command

sudo echo 85 is one which is running as root and the redirection one the second


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-06-04 17:44:32

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [solved] sudo not granting full root privileges?

echo 85 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

the redirection (the >) is ran by your shell which doesn't run as root.

Offline

#4 2010-06-04 17:45:44

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [solved] sudo not granting full root privileges?

Edit: too slow.

Last edited by Stebalien (2010-06-04 17:46:17)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#5 2010-06-04 17:48:12

Barghest
Member
From: Hanau/Germany
Registered: 2008-01-03
Posts: 563

Re: [solved] sudo not granting full root privileges?

wow...this was fast...thanks mates

Offline

#6 2010-06-04 19:06:22

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [solved] sudo not granting full root privileges?

you can circumvent that by using echo 85 | sudo tee /sys/...


no place like /home
github

Offline

#7 2010-06-04 19:30:13

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] sudo not granting full root privileges?

You can also subshell the entire thing with elevated permissions:

su -c 'echo 85 > /blah/blah/blah'

Offline

#8 2010-06-04 19:36:33

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [solved] sudo not granting full root privileges?

and you use "tee -a" to append, instead of >>


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

Board footer

Powered by FluxBB