Ticket #611 (new enhancement)
protect users from themselves when they use sudo inappropriately
|Reported by:||duncan||Owned by:|
Users sometimes get themselves into trouble with sudo. For example:
sudo cabal install blah
sudo cabal update
In both cases, the user is doing actions as root that modify their normal-user files.
In the first case it will install a package into ~/.cabal/ but of course all the files owned by root, so the user cannot delete them again later.
In the second case cabal will as root update the per-user package index. This will make further updates not as root fail, and worse because of a file permissions bug, the index will not be readable as their normal user.
The aim would be to protect users from themselves and tell them when they're doing something that's almost certainly wrong. We could suggest alternatives, like don't use sudo if you wanted to do a per-user install, or use sudo and --global if you did.
The tricky bit is making a suitably accurate test and making it possible to do the silly thing, if that's what the user really really wanted.