Author: mckusick Date: Mon Jan 28 21:48:04 2019 New Revision: 343538 URL: https://svnweb.freebsd.org/changeset/base/343538
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/11/sbin/newfs/newfs.8 stable/11/sbin/newfs/newfs.c stable/11/sbin/tunefs/tunefs.8 stable/11/sbin/tunefs/tunefs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/newfs/newfs.8 ============================================================================== --- stable/11/sbin/newfs/newfs.8 Mon Jan 28 21:46:05 2019 (r343537) +++ stable/11/sbin/newfs/newfs.8 Mon Jan 28 21:48:04 2019 (r343538) @@ -91,6 +91,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/11/sbin/newfs/newfs.c ============================================================================== --- stable/11/sbin/newfs/newfs.c Mon Jan 28 21:46:05 2019 (r343537) +++ stable/11/sbin/newfs/newfs.c Mon Jan 28 21:48:04 2019 (r343538) @@ -153,7 +153,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/11/sbin/tunefs/tunefs.8 ============================================================================== --- stable/11/sbin/tunefs/tunefs.8 Mon Jan 28 21:46:05 2019 (r343537) +++ stable/11/sbin/tunefs/tunefs.8 Mon Jan 28 21:48:04 2019 (r343538) @@ -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/11/sbin/tunefs/tunefs.c ============================================================================== --- stable/11/sbin/tunefs/tunefs.c Mon Jan 28 21:46:05 2019 (r343537) +++ stable/11/sbin/tunefs/tunefs.c Mon Jan 28 21:48:04 2019 (r343538) @@ -184,11 +184,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.", _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"