svn commit: r274631 - head/sbin/geom/core
Mark Felder
feld at FreeBSD.org
Mon Nov 17 15:19:58 UTC 2014
Author: feld (ports committer)
Date: Mon Nov 17 15:19:57 2014
New Revision: 274631
URL: https://svnweb.freebsd.org/changeset/base/274631
Log:
Fix geom's "usage" generation to not fabricate usage/help output for any
imaginary class we give it.
Differential Revision: https://reviews.freebsd.org/D1150
Submitted by: homerj
Approved by: pjd
Modified:
head/sbin/geom/core/geom.c
Modified: head/sbin/geom/core/geom.c
==============================================================================
--- head/sbin/geom/core/geom.c Mon Nov 17 15:12:46 2014 (r274630)
+++ head/sbin/geom/core/geom.c Mon Nov 17 15:19:57 2014 (r274631)
@@ -640,6 +640,11 @@ get_class(int *argc, char ***argv)
#endif /* !STATIC_GEOM_CLASSES */
set_class_name();
+
+ /* If we can't load or list, it's not a class. */
+ if (!std_available("load") && !std_available("list"))
+ errx(EXIT_FAILURE, "Invalid class name.");
+
if (*argc < 1)
usage();
}
More information about the svn-src-head
mailing list