MFC of 320176:

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

PR: 220163
Reported by: Keve Nagy
Reviewed by: kib
This commit is contained in:
Kirk McKusick 2017-06-26 17:33:33 +00:00
parent f07b5deca8
commit 8ef57fa6f3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=320366

View File

@ -153,7 +153,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.");
}