From owner-svn-src-stable@freebsd.org Fri Apr 13 03:47:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A49EF8758A; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05CEB87286; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 009A5148FC; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3lfG7050580; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3lfTx050579; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804130347.w3D3lfTx050579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 13 Apr 2018 03:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Group: stable-10 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Commit-Revision: 332465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:47:42 -0000 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/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/reboot/reboot.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Fri Apr 13 03:32:18 2018 (r332464) +++ stable/10/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");