Sudoers list?

Peter Garrett peter.garrett at optusnet.com.au
Tue Apr 4 23:25:43 UTC 2006


On Wed, 5 Apr 2006 07:43:59 +1000
Matthew Palmer <mpalmer at hezmatt.org> wrote:

> > I don't want to force people to run this script as root. Running stuff 
> > as root is a really bad habit. I want this script to be as non-root 
> > friendly as possible. There is only one step that *might* warrant root 
> > access and that's if the destination directory belongs to root.
> 
> How is it better for a script to say "hey, can you give me root privs now"
> before doing something nasty, as opposed to saying "you have to give me root
> privileges at the beginning" before doing something nasty?

Because there are two use cases:

1. The installation is made to a directory not requiring root privileges
( $HOME for instance )

2. The installation is system-wide and is going to be in, say, /usr

If (1), then the script does not require root privileges
If (2), then it only requires root privileges for the actual writing /
installation to the relevant directory.

Hence, why ask for root privileges if the user is only installing to his
$HOME directory?

Seems to me that it is sensible to write the script in such a way that it
only asks for the minimum privileges required...

Peter

-- 

Linux User #343161 




More information about the ubuntu-users mailing list