Date: Fri, 12 Jul 2013 22:16:43 +0000 (UTC) From: Jim Harris <jimharris@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253302 - stable/9/sbin/nvmecontrol Message-ID: <201307122216.r6CMGhtU069522@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jimharris Date: Fri Jul 12 22:16:43 2013 New Revision: 253302 URL: http://svnweb.freebsd.org/changeset/base/253302 Log: MFC r253116: Ensure controller or namespace node name is specified before trying to access it. While here, also fix the identify usage message to show the -v and -x parameters. Approved by: re (kib) Modified: stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Fri Jul 12 22:15:50 2013 (r253301) +++ stable/9/sbin/nvmecontrol/identify.c Fri Jul 12 22:16:43 2013 (r253302) @@ -259,6 +259,10 @@ identify(int argc, char *argv[]) while (getopt(argc, argv, "vx") != -1) ; + /* Check that a controller or namespace was specified. */ + if (optind >= argc) + identify_usage(); + target = argv[optind]; optreset = 1; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Fri Jul 12 22:15:50 2013 (r253301) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Fri Jul 12 22:16:43 2013 (r253302) @@ -38,7 +38,7 @@ " nvmecontrol devlist\n" #define IDENTIFY_USAGE \ -" nvmecontrol identify <controller id|namespace id>\n" +" nvmecontrol identify [-x [-v]] <controller id|namespace id>\n" #define PERFTEST_USAGE \ " nvmecontrol perftest <-n num_threads> <-o read|write>\n" \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307122216.r6CMGhtU069522>