svn commit: r320365 - stable/11/sbin/newfs

Kirk McKusick mckusick at FreeBSD.org
Mon Jun 26 17:29:33 UTC 2017


Author: mckusick
Date: Mon Jun 26 17:29:32 2017
New Revision: 320365
URL: https://svnweb.freebsd.org/changeset/base/320365

Log:
  MFC of 320176:
  
  Allow '_' in labels when specifying -L to newfs.
  
  PR: 220163
  Reported by: Keve Nagy
  Reviewed by: kib
  Approved by: re@ (Xin Li)

Modified:
  stable/11/sbin/newfs/newfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/newfs/newfs.c
==============================================================================
--- stable/11/sbin/newfs/newfs.c	Mon Jun 26 16:28:46 2017	(r320364)
+++ stable/11/sbin/newfs/newfs.c	Mon Jun 26 17:29:32 2017	(r320365)
@@ -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.");
 			}


More information about the svn-src-stable mailing list