History log of /freebsd-10-stable/bin/rm/rm.c
Revision Date Author Comments
# 290634 10-Nov-2015 bapt

MFC r290480

Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1
edition 2013. No need anymore to disable the protection if one set
the POXILY_CORRECT environment variable.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D4092


# 287791 14-Sep-2015 delphij

MFC r287237: Respect locale settings.


# 272372 01-Oct-2014 gjb

MFC r268376 (imp):

rm -rf can fail sometimes with an error from fts_read. Make it
honor fflag to ignore fts_read errors, but stop deleting from
that directory because no further progress can be made.

When building a kernel with a high -j value on a high core count
machine, during the cleanobj phase we can wind up doing multiple
rm -rf at the same time for modules that have subdirectories. This
exposed this race (sometimes) as fts_read can return an error if
the directory is removed by another rm -rf. Since the intent of
the -f flag was to ignore errors, even if this was a bug in
fts_read, we should ignore the error like we've been instructed
to do.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation


# 287791 14-Sep-2015 delphij

MFC r287237: Respect locale settings.


# 272372 01-Oct-2014 gjb

MFC r268376 (imp):

rm -rf can fail sometimes with an error from fts_read. Make it
honor fflag to ignore fts_read errors, but stop deleting from
that directory because no further progress can be made.

When building a kernel with a high -j value on a high core count
machine, during the cleanobj phase we can wind up doing multiple
rm -rf at the same time for modules that have subdirectories. This
exposed this race (sometimes) as fts_read can return an error if
the directory is removed by another rm -rf. Since the intent of
the -f flag was to ignore errors, even if this was a bug in
fts_read, we should ignore the error like we've been instructed
to do.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation