[nycbug-talk] Safety Expansion for FreeBSD rm(1)

Nathan Boeger nboeger at khmere.com
Tue Oct 2 14:22:46 EDT 2007


Steven Kreuzer wrote:
> Greetings-
>
> I am reading through the freebsd-current mailing list and I stumbled upon a
> proposed patch that I thought was rather interesting
>
> Basically, is a patch to rm that first reads ~/.rm before actually removing
> anything to make sure that what you are trying to delete isn't "protected"
>
> Example, if I did rm -rf ~ /bin (when I really wanted ~/bin) it would check
> to make sure that /bin and ~ are allowed to be removed.
>
> I am kinda on the fence about this, but think it could be a useful way to
> protect yourself from yourself
>
> Project Page: http://people.freebsd.org/~daichi/safety-rm/
> eMail thread on freebsd-current: http://marc.info/?l=freebsd-current&m=119072708632143&w=2
>
> What do you think?
>
>   
So here is a few questions:

1. What if  someone aliased: cat /dev/null > ~/.rmrc?

2. What if rm is has setuid bit on it for some strange reason? Then 
would your ~/.rmrc still be read?

3. What if I dd if=/dev/random of=~/.rmrc  and make it some huge blob. 
Could this expose a buffer overun?

4. Will rm need to check if the ~/.rmrc is hard or soft linked?

5. Would rm never be allowed to remove `/.rmrc or would you need to list 
it inside its own file?




More information about the talk mailing list