Page MenuHomeFreeBSD

protecting against rm -rf / is now POSIXLY_CORRECT
ClosedPublic

Authored by bapt on Nov 6 2015, 8:07 AM.
Tags
None
Referenced Files
F165890627: D4092.id9980.diff
Mon, Aug 10, 10:30 AM
Unknown Object (File)
Tue, Aug 4, 5:10 AM
Unknown Object (File)
Sat, Jul 25, 3:31 AM
Unknown Object (File)
Wed, Jul 22, 12:11 PM
Unknown Object (File)
Mon, Jul 20, 12:26 AM
Unknown Object (File)
Sun, Jul 12, 8:05 PM
Unknown Object (File)
Jul 5 2026, 9:10 AM
Unknown Object (File)
Jul 5 2026, 6:03 AM
Subscribers

Details

Summary

Per POSIX 1003.1, 2013:

if an operand resolves to the root directory, rm shall write a diagnostic
message to standard error and do nothing more with such operands.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bapt retitled this revision from to protecting against rm -rf / is now POSIXLY_CORRECT.
bapt updated this object.
bapt edited the test plan for this revision. (Show Details)
bapt added a reviewer: des.
imp added a reviewer: imp.

You need to update the man page to say this is expected to comply with the 2013 version in the standards section.

I'm a little sad to see POSIXLY_CORRECT go, but I would have been sadder if we had the off-color POSIX_ME_HARDER and it was going...

This revision is now accepted and ready to land.Nov 6 2015, 4:37 PM
This revision was automatically updated to reflect the committed changes.