Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Feb 2011 16:30:27 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r218919 - stable/8/sys/geom/label
Message-ID:  <201102211630.p1LGURlt076214@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Mon Feb 21 16:30:27 2011
New Revision: 218919
URL: http://svn.freebsd.org/changeset/base/218919

Log:
  MFC r216098:
  
  - Report an error when a label with invalid name is attempted to be
    created with glabel(8).
  - Fix a typo in an error message.
  - Fix comment typos.

Modified:
  stable/8/sys/geom/label/g_label.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/geom/label/g_label.c
==============================================================================
--- stable/8/sys/geom/label/g_label.c	Mon Feb 21 16:21:43 2011	(r218918)
+++ stable/8/sys/geom/label/g_label.c	Mon Feb 21 16:30:27 2011	(r218919)
@@ -124,13 +124,13 @@ g_label_is_name_ok(const char *label)
 {
 	const char *s;
 
-	/* Check is the label starts from ../ */
+	/* Check if the label starts from ../ */
 	if (strncmp(label, "../", 3) == 0)
 		return (0);
-	/* Check is the label contains /../ */
+	/* Check if the label contains /../ */
 	if (strstr(label, "/../") != NULL)
 		return (0);
-	/* Check is the label ends at ../ */
+	/* Check if the label ends at ../ */
 	if ((s = strstr(label, "/..")) != NULL && s[3] == '\0')
 		return (0);
 	return (1);
@@ -151,6 +151,8 @@ g_label_create(struct gctl_req *req, str
 		G_LABEL_DEBUG(0, "%s contains suspicious label, skipping.",
 		    pp->name);
 		G_LABEL_DEBUG(1, "%s suspicious label is: %s", pp->name, label);
+		if (req != NULL)
+			gctl_error(req, "Label name %s is invalid.", label);
 		return (NULL);
 	}
 	gp = NULL;
@@ -346,7 +348,7 @@ g_label_ctl_create(struct gctl_req *req,
 		return;
 	}
 	if (*nargs != 2) {
-		gctl_error(req, "Invalid number of argument.");
+		gctl_error(req, "Invalid number of arguments.");
 		return;
 	}
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102211630.p1LGURlt076214>