On 10/25/2011 08:09 PM, William Shackleton wrote: I wrote a similar program to control the brightness; it's a C program which sets the value and can be run through awesome's run command. The advantage of writing a simple C program to do this (and storing it in /usr/local/bin) is that the setuid bit can be set; this makes the program run as root no matter who runs it. Shell scripts can't have the setuid bit set.
I use /etc/sudoers with NOPASSWD for those scripts/commands that should be available to run as root for everyone. For years I've been using that feature to enable binding "sudo s2disk" to power button. Not an ultimate solution (every new script should be added manually to minimize security concerns), but certainly an alternative to creating a full-fledged C program every time full-time root permissions are needed for certain command to run.
