You are not logged in.
Okay - I know the title of this post is not quite descriptive enough etc. I just don't know what to call it...
I'm trying to get my backlight working fully on my Sony Vaio PCG-GRT390ZP. I can modprobe the sony_laptop module and then echo the different values to the respective files like this:
# echo 5 > /sys/class/backlight/sony/brightness
I'm trying to get some python scripts written to handle the above command. (I'm using python because I'm more comfortable in that than in plain bash / sh, and I have the python packages already.) Because of the scripting, I need to have write access in /sys as a normal user. I'm looking for the safest way to achieve this, as I can't imagine that
chown -R <user> users /sys
is safe at all. Any suggestions? Thanks a lot.
"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)
Offline
You could set the suid flag for your script.
chmod u+s /path/to/yourScript
Or you could use sudo
Offline
Setting the suid flag for the scripts didn't seem to work, I think because the suid flag only affects binaries (though I could certainly be wrong - that's just what I read)
So I went ahead and added the lines I needed to my sudoers to launch this script as root without a password every time it's run (Since all this does is change the screen brightness I think I should be pretty safe. Unless others have differing opinions?)
Thanks again for the brain jog. Sometimes that's all you need. (Now I just need to set up xbindkeys to launch these scripts I just wrote)
"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)
Offline