Allow tunefs to include '_' as a legal character in label names

to make it consistent with newfs. Document the legality of '_'
in label names in both tunefs(8) and newfs(8).

PR:           235182
Submitted by: darius@dons.net.au
Reviewed by:  Conrad Meyer
MFC after:    3 days
Sponsored by: Netflix
This commit is contained in:
Kirk McKusick 2019-01-25 20:07:18 +00:00
parent 04a50a5272
commit 0cde0ab2d3
3 changed files with 3 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -189,7 +189,7 @@ 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.",