[ale] Sudo

Stephen Cristol stephen at bee.net
Wed May 18 20:39:08 EDT 2005


On May 18, 2005, at 5:21 PM, Jim Popovitch wrote:
> What I think would be neat is for bash (or other shells) to remember
> sudo commands that users run and to automatically invoke sudo the next
> time I run the command without it.  Knowing when to use sudo is not the
> issue here, having sudo know when it is needed is.
>
> 1) Why would this be good/bad?

One way this could be bad is that some commands offer different 
capabilities to root and non-privileged users. A shell cannot predict 
with certainty whether it should request a privilege escalation or not 
in such a situation.

Consider the "unlink" command. This will fail if a non-privileged user 
tries to remove a non-empty directory. If root gives the same command, 
it is likely to succeed. What I've read on the subject suggests this 
can seriously damage a file system.

What should the shell do when you try to unlink a non-empty directory?

S

-- 
Stephen Cristol
cristol at emory.edu



More information about the Ale mailing list