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)
Wed, Apr 10, 8:46 PM
Unknown Object (File)
Wed, Apr 10, 8:46 PM
Unknown Object (File)
Wed, Apr 10, 8:46 PM
Unknown Object (File)
Tue, Apr 9, 12:18 PM
Unknown Object (File)
Mon, Apr 8, 4:05 PM
Unknown Object (File)
Mon, Apr 8, 8:26 AM
Unknown Object (File)
Wed, Apr 3, 1:23 AM
Unknown Object (File)
Mar 10 2024, 10:41 PM
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.