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"); _______________________________________________ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"