Sudoers list?

Daniel Carrera daniel.carrera at zmsl.com
Tue Apr 4 23:12:37 UTC 2006


Matthew Palmer wrote:
> 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?

One difference is that the user has the option to click "cancel" and 
choose a different directory. So they can choose to run it entirely 
without root.

Another difference applies to well-intentioned but buggy scripts. When 
you trust the script writer's intentions, but not his coding skills :) 
it doesn't hurt to minimise the time spent as root.

Another difference applies just to me as a coder. Minimising the time 
spent as root helps me write a better script. If it was run as root I 
might miss a bug. This is just a better design. The script has 200 lines 
and only one of them has any reason to be root (a copy command). I don't 
want to run the other 199 lines as root for no reason.

Cheers,
Daniel.
-- 
      /\/`) http://opendocumentfellowship.org
     /\/_/
    /\/_/   A life? Sounds great!
    \/_/    Do you know where I could download one?
    /




More information about the ubuntu-users mailing list