Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Apr 2018 03:47:42 +0000 (UTC)
From:      "Rodney W. Grimes" <rgrimes@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot
Message-ID:  <201804130347.w3D3lg3t050585@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rgrimes
Date: Fri Apr 13 03:47:41 2018
New Revision: 332465
URL: https://svnweb.freebsd.org/changeset/base/332465

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

Modified:
  stable/11/sbin/reboot/reboot.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sbin/reboot/reboot.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sbin/reboot/reboot.c
==============================================================================
--- stable/11/sbin/reboot/reboot.c	Fri Apr 13 03:32:18 2018	(r332464)
+++ stable/11/sbin/reboot/reboot.c	Fri Apr 13 03:47:41 2018	(r332465)
@@ -111,6 +111,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?201804130347.w3D3lg3t050585>