Subject: bin/3552: 'disklabel' cannot cope with fstypenames containing spaces
To: None <gnats-bugs@gnats.netbsd.org>
From: None <abs@mono.org>
List: netbsd-bugs
Date: 04/28/1997 08:23:02
>Number:         3552
>Category:       bin
>Synopsis:       'disklabel' cannot cope with fstypenames containing spaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 28 00:35:01 1997
>Last-Modified:
>Originator:     David Brownlee
>Organization:
<a href="http://www.mono.org/">Monochrome</a>
>Release:        1.2
>Environment:
System: NetBSD lapton.mono.org 1.2D NetBSD 1.2D (_LAPTON_) #3: Sun Apr 27 22:24:02 BST 1997 root@lapton.mono.org:/usr/src/sys/arch/i386/compile/_LAPTON_ i386


>Description:
	Disklabel parses input files by splitting on whitespace. This means
	fstypenames such as 'System V' cannot be parsed (it reports that
	'System' is an unknown filesystem type.

	(I somehow managed to generate disklabels with a 'System V' filesystem
	type by missing out the cpg value, which was more than a littl bizarre.
	I hope to look at this and submit a pr when I have a spare disk to
	disklabel - anyway, that is irrelevant to this pr! :)

>How-To-Repeat:
	Try to edit a disklabel with a 'System V' filesystem.

>Fix:
	One option is to ensure fstypenames do not contain spaces
	(patch to sys/disklabel.h enclosed). This should not break
	any existing setups as any text representations of disklabels
	containing 'Version 7' or similar cannot be used anyway!

	Another option would be to make disklabel much more intelligent
	when parsing. (Might apply to edlabel as well, though I don't
	_think_ so). This sounds like it could be messy :)

*** sys/disklabel.h	Wed Jan 22 17:46:50 1997
--- sys/disklabel.h.new	Mon Apr 28 08:11:43 1997
***************
*** 243,253 ****
  static char *fstypenames[] = {
  	"unused",
  	"swap",
! 	"Version 6",
! 	"Version 7",
! 	"System V",
  	"4.1BSD",
! 	"Eighth Edition",
  	"4.2BSD",
  	"MSDOS",
  	"4.4LFS",
--- 243,253 ----
  static char *fstypenames[] = {
  	"unused",
  	"swap",
! 	"Version-6",
! 	"Version-7",
! 	"System-V",
  	"4.1BSD",
! 	"Eighth-Edition",
  	"4.2BSD",
  	"MSDOS",
  	"4.4LFS",
>Audit-Trail:
>Unformatted: