On Wednesday, February 13, 2002, at 01:43 PM, Jason Ramey wrote:
correct, an example is as follows:
puck ALL= NOPASSWD: /usr/bin/pico -w /etc/bind/[A-z]*
I'm letting puck edit anything in /etc/bind/ using sudo, no password
required. this should fit your needs.
Remember that most editors let you do interesting things. Like
open arbitrary files. Or execute shell commands. I'm not sure
about pico, but imagine the fun you can have by opening
/etc/shadow or /etc/passwd. Wow, puck now has uid 0 ;-)
Also, at least vi will let you run commands of your choice. Pico
might even.
I'd _strongly_ suggest doing something like this, assuming you
need to use sudo (for logging, for example). Write a C/perl
program that:
1) Copies the file (securely) to something in /tmp
2) forks
child:
1) Drop all priveleges
2) Spawn user's $VISUAL or $EDITOR.
3) Wait for child process to die
4) If successful, install change.
This way, the editor (which you shouldn't trust) never runs with
privileges.