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
Unknown Object (File)
Mon, Jan 13, 8:07 AM
Unknown Object (File)
Sat, Jan 4, 6:57 PM
Unknown Object (File)
Mon, Dec 30, 5:00 PM
Unknown Object (File)
Sat, Dec 28, 12:21 AM
Unknown Object (File)
Nov 27 2024, 4:29 AM
Unknown Object (File)
Nov 25 2024, 5:42 PM
Unknown Object (File)
Nov 24 2024, 1:25 AM
Unknown Object (File)
Nov 24 2024, 1:17 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 Passed
Unit
No Test Coverage
Build Status
Buildable 1047
Build 1050: arc lint + arc unit

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.