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