[patch] rm can have undesired side-effects

soralx at cydem.org soralx at cydem.org
Mon Oct 30 10:03:56 UTC 2006

> > protections at a later date.  Unless Alice notices that her file
> > has a second link before she deletes it, when she issues "rm -P",
> > she will lose her link to the file (and her only way of uniquely
> > identifying it) whilst leaving the remaining link to the file in
> > Mallory's control.

well, that's the whole point of '-P' -- erase file's data _before_
unlinking the file, is it not?

> That isn't really that nice, true. But why can i link files that I
> have no business with in the first place? Is there is specific reason?

if you can't see the contents of other user's directory (think '0750')
you really will get no buisiness there, whether you want it or not

Of course, one must be careful when using `rm -P` (which, ironically,
is very likely to happen in limited-time situations), and even the
protection of requiring the '-f' flag if {(inode count) > 1} is
inadequate protection for fools like me (who are used to good ol'
`rm -rf` on large directory structures) ;P

[SorAlx]  ridin' VN1500-B2

More information about the freebsd-hackers mailing list