Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2018 15:00:08 +0000 (UTC)
From:      "Rodney W. Grimes" <rgrimes@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332075 - head/sbin/reboot
Message-ID:  <201804051500.w35F08kG059482@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rgrimes
Date: Thu Apr  5 15:00:08 2018
New Revision: 332075
URL: https://svnweb.freebsd.org/changeset/base/332075

Log:
  Exit with usage when extra arguments are on command line
  preventing mistakes such as "halt 0p" for "halt -p".
  Approved by:	bde (mentor), phk (mentor)
  MFC after:	1 week

Modified:
  head/sbin/reboot/reboot.c

Modified: head/sbin/reboot/reboot.c
==============================================================================
--- head/sbin/reboot/reboot.c	Thu Apr  5 14:55:44 2018	(r332074)
+++ head/sbin/reboot/reboot.c	Thu Apr  5 15:00:08 2018	(r332075)
@@ -116,6 +116,8 @@ main(int argc, char *argv[])
 		}
 	argc -= optind;
 	argv += optind;
+	if (argc != 0)
+		usage();
 
 	if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
 		errx(1, "cannot dump (-d) when halting; must reboot instead");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804051500.w35F08kG059482>