Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jan 2019 21:46:06 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343537 - in stable/12/sbin: newfs tunefs
Message-ID:  <201901282146.x0SLk6E9053385@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Mon Jan 28 21:46:05 2019
New Revision: 343537
URL: https://svnweb.freebsd.org/changeset/base/343537

Log:
  MFC of 343449 and 343483
  
  Update tunefs to allow '_' in label names.
  
  Update tunefs and newfs error messages to note that '_' is allowed
  in label names.
  
  Sponsored by: Netflix

Modified:
  stable/12/sbin/newfs/newfs.8
  stable/12/sbin/newfs/newfs.c
  stable/12/sbin/tunefs/tunefs.8
  stable/12/sbin/tunefs/tunefs.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/newfs/newfs.8
==============================================================================
--- stable/12/sbin/newfs/newfs.8	Mon Jan 28 21:36:45 2019	(r343536)
+++ stable/12/sbin/newfs/newfs.8	Mon Jan 28 21:46:05 2019	(r343537)
@@ -89,6 +89,7 @@ See
 for details.
 .It Fl L Ar volname
 Add a volume label to the new file system.
+Legal characters are alphanumerics and underscores.
 .It Fl N
 Cause the file system parameters to be printed out
 without really creating the file system.

Modified: stable/12/sbin/newfs/newfs.c
==============================================================================
--- stable/12/sbin/newfs/newfs.c	Mon Jan 28 21:36:45 2019	(r343536)
+++ stable/12/sbin/newfs/newfs.c	Mon Jan 28 21:46:05 2019	(r343537)
@@ -155,7 +155,8 @@ main(int argc, char *argv[])
 			while (isalnum(volumelabel[++i]) ||
 			    volumelabel[i] == '_');
 			if (volumelabel[i] != '\0') {
-				errx(1, "bad volume label. Valid characters are alphanumerics.");
+				errx(1, "bad volume label. Valid characters "
+				    "are alphanumerics and underscores.");
 			}
 			if (strlen(volumelabel) >= MAXVOLLEN) {
 				errx(1, "bad volume label. Length is longer than %d.",

Modified: stable/12/sbin/tunefs/tunefs.8
==============================================================================
--- stable/12/sbin/tunefs/tunefs.8	Mon Jan 28 21:36:45 2019	(r343536)
+++ stable/12/sbin/tunefs/tunefs.8	Mon Jan 28 21:46:05 2019	(r343537)
@@ -112,6 +112,7 @@ By default
 sets it to half of the space reserved to minfree.
 .It Fl L Ar volname
 Add/modify an optional file system volume label.
+Legal characters are alphanumerics and underscores.
 .It Fl l Cm enable | disable
 Turn on/off MAC multilabel flag.
 .It Fl m Ar minfree

Modified: stable/12/sbin/tunefs/tunefs.c
==============================================================================
--- stable/12/sbin/tunefs/tunefs.c	Mon Jan 28 21:36:45 2019	(r343536)
+++ stable/12/sbin/tunefs/tunefs.c	Mon Jan 28 21:46:05 2019	(r343537)
@@ -189,11 +189,10 @@ main(int argc, char *argv[])
 			name = "volume label";
 			Lvalue = optarg;
 			i = -1;
-			while (isalnum(Lvalue[++i]));
+			while (isalnum(Lvalue[++i]) || Lvalue[i] == '_');
 			if (Lvalue[i] != '\0') {
-				errx(10,
-				"bad %s. Valid characters are alphanumerics.",
-				    name);
+				errx(10, "bad %s. Valid characters are "
+				    "alphanumerics and underscores.", name);
 			}
 			if (strlen(Lvalue) >= MAXVOLLEN) {
 				errx(10, "bad %s. Length is longer than %d.",



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