From junichi@junichi.org  Sat Oct 31 21:44:23 1998
Received: from meshsv62.os.mesh.ad.jp (meshsv62.os.mesh.ad.jp [133.205.64.130])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12930
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Oct 1998 21:44:23 -0800 (PST)
          (envelope-from junichi@junichi.org)
Received: from mqh-host.junichi.org (omy15DS54.stm.mesh.ad.jp [210.147.49.54]) by meshsv62.os.mesh.ad.jp (8.8.8+2.7Wbeta7/3.5Wpl1-98033110) with ESMTP id OAA08290 for <FreeBSD-gnats-submit@freebsd.org>; Sun, 1 Nov 1998 14:44:18 +0900 (JST)
Received: from atlantis.junichi.org (atlantis.junichi.org [192.168.31.2])
	by mqh-host.junichi.org (8.8.8/3.6W-MQH-1.0) with ESMTP id OAA09717
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 1 Nov 1998 14:44:11 +0900 (JST)
Received: (from junichi@localhost)
	by atlantis.junichi.org (8.9.1/8.8.8) id WAA06615;
	Sat, 31 Oct 1998 22:47:39 +0900 (JST)
	(envelope-from junichi)
Message-Id: <199810311347.WAA06615@atlantis.junichi.org>
Date: Sat, 31 Oct 1998 22:47:39 +0900 (JST)
From: junichi@jp.FreeBSD.ORG
Reply-To: junichi@jp.FreeBSD.ORG
To: FreeBSD-gnats-submit@freebsd.org
Subject: libdisk problem.
X-Send-Pr-Version: 3.2

>Number:         8523
>Category:       bin
>Synopsis:       The Write_Disk() doesn't support any length of device name.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 31 21:50:00 PST 1998
>Closed-Date:    Sun Nov 1 00:19:50 PST 1998
>Last-Modified:  Sun Nov  1 00:20:15 PST 1998
>Originator:     Junichi Satoh
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD-2.2.x, FreeBSD-3.0-current

>Description:

The Write_Disk() doesn't support any length of device names.
It supports only two characters, wd, da, etc...

>How-To-Repeat:

On /stand/sysinsatll, we can not create slices on 'wfd' devices.


>Fix:

Apply following patch to /usr/lib/libdisk/write_disk.c.
It's for -current.


*** write_disk.c.org	Tue Oct  6 20:57:08 1998
--- write_disk.c	Thu Oct 22 21:46:09 1998
***************
*** 64,73 ****
  	for(c2=c1->part;c2;c2=c2->next) {
  		if (c2->type == unused) continue;
  		if (!strcmp(c2->name,"X")) continue;
! 		j = c2->name[5] - 'a';
  		if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
  #ifdef DEBUG
! 			warn("Weird parititon letter %c",c2->name[5]);
  #endif
  			continue;
  		}
--- 64,73 ----
  	for(c2=c1->part;c2;c2=c2->next) {
  		if (c2->type == unused) continue;
  		if (!strcmp(c2->name,"X")) continue;
! 		j = c2->name[strlen(new->name) + 2] - 'a';
  		if (j < 0 || j >= MAXPARTITIONS || j == RAW_PART) {
  #ifdef DEBUG
! 			warn("Weird parititon letter %c",c2->name[strlen(new->name) + 2]);
  #endif
  			continue;
  		}
***************
*** 172,178 ****
  	for (c1=d1->chunks->part; c1 ; c1 = c1->next) {
  		if (c1->type == unused) continue;
  		if (!strcmp(c1->name,"X")) continue;
! 		j = c1->name[4] - '1';
  		if (j < 0 || j > 3)
  			continue;
  		s[j]++;
--- 172,178 ----
  	for (c1=d1->chunks->part; c1 ; c1 = c1->next) {
  		if (c1->type == unused) continue;
  		if (!strcmp(c1->name,"X")) continue;
! 		j = c1->name[strlen(d1->name) + 1] - '1';
  		if (j < 0 || j > 3)
  			continue;
  		s[j]++;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Nov 1 00:19:50 PST 1998 
State-Changed-Why:  
this has already been fixed in other ways as part of the alpha port. 
>Unformatted:
