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
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D4092
This commit is contained in:
Baptiste Daroussin 2015-11-07 02:18:19 +00:00
parent 1dbbea5554
commit 8e5c71e2d6
2 changed files with 3 additions and 4 deletions

View File

@ -32,7 +32,7 @@
.\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" @(#)rm.1 8.5 (Berkeley) 12/5/94
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd April 25, 2013 .Dd November 7, 2015
.Dt RM 1 .Dt RM 1
.Os .Os
.Sh NAME .Sh NAME
@ -234,7 +234,7 @@ not the standard error output.
The The
.Nm .Nm
command conforms to command conforms to
.St -p1003.2 . .St -p1003.1-2013 .
.Pp .Pp
The simplified The simplified
.Nm unlink .Nm unlink

View File

@ -155,8 +155,7 @@ main(int argc, char *argv[])
} }
checkdot(argv); checkdot(argv);
if (getenv("POSIXLY_CORRECT") == NULL) checkslash(argv);
checkslash(argv);
uid = geteuid(); uid = geteuid();
(void)signal(SIGINFO, siginfo); (void)signal(SIGINFO, siginfo);