From owner-svn-src-stable@FreeBSD.ORG Mon Feb 21 16:33:01 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68FA31065673; Mon, 21 Feb 2011 16:33:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568FB8FC17; Mon, 21 Feb 2011 16:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1LGX1Ui076318; Mon, 21 Feb 2011 16:33:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1LGX1wY076316; Mon, 21 Feb 2011 16:33:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201102211633.p1LGX1wY076316@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 21 Feb 2011 16:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218920 - stable/7/sys/geom/label X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2011 16:33:01 -0000 Author: jh Date: Mon Feb 21 16:33:01 2011 New Revision: 218920 URL: http://svn.freebsd.org/changeset/base/218920 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/7/sys/geom/label/g_label.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/label/g_label.c ============================================================================== --- stable/7/sys/geom/label/g_label.c Mon Feb 21 16:30:27 2011 (r218919) +++ stable/7/sys/geom/label/g_label.c Mon Feb 21 16:33:01 2011 (r218920) @@ -123,13 +123,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); @@ -150,6 +150,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; @@ -339,7 +341,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; } /*