Allow '_' in labels when specifying -L to newfs.

Reported by: Keve Nagy
Reviewed by: kib
PR: 220163
MFC after: 5 days
This commit is contained in:
Kirk McKusick 2017-06-20 21:26:42 +00:00
parent d2b62c5897
commit aeb2785c30

View File

@ -150,7 +150,8 @@ main(int argc, char *argv[])
case 'L':
volumelabel = optarg;
i = -1;
while (isalnum(volumelabel[++i]));
while (isalnum(volumelabel[++i]) ||
volumelabel[i] == '_');
if (volumelabel[i] != '\0') {
errx(1, "bad volume label. Valid characters are alphanumerics.");
}