There are plenty of good reasons to run as root. On systems without capacility functions, it's the only way to get privileged access to restricted resources. For instance, Apache is usually suid root so that it can listen on port 80 (only accessable to root). It then switches users but keeps the network socket.
Perl programs can do this fairly reliably in the Unix world by passing the socket handle through a pipe to an unprivileged child, or just passing the relevant data.
I agree that programmers should avoid writing programs that run as root, but a lot of mine do because they automate system admin jobs that must be done as root.
avoid running the prog as root in the first place, unless this program will never live on a machine that ever gets connected to the internet.
Your operating system runs as root, you know :)
____________________
Jeremy
I didn't believe in evil until I dated it. |