From hu006co@mail.euroweb.hu Wed Jul 28 06:04:33 1999
Return-Path: <hu006co@mail.euroweb.hu>
Received: from mail.euroweb.hu (mail.euroweb.hu [193.226.220.4])
	by hub.freebsd.org (Postfix) with ESMTP id A382215474
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 28 Jul 1999 06:04:11 -0700 (PDT)
	(envelope-from hu006co@mail.euroweb.hu)
Received: (from hu006co@localhost)
	by mail.euroweb.hu (8.8.5/8.8.5) id OAA13277
	for FreeBSD-gnats-submit@freebsd.org; Wed, 28 Jul 1999 14:48:28 +0200 (MET DST)
Received: (from zgabor@localhost)
	by CoDe.hu (8.8.8/8.8.8) id OAA00539;
	Wed, 28 Jul 1999 14:47:20 +0200 (CEST)
	(envelope-from zgabor)
Message-Id: <199907281247.OAA00539@CoDe.hu>
Date: Wed, 28 Jul 1999 14:47:20 +0200 (CEST)
From: zgabor@CoDe.hu
Sender: hu006co@mail.euroweb.hu
Reply-To: zgabor@CoDe.hu
To: FreeBSD-gnats-submit@freebsd.org
Subject: bug in 3.x's new i386 bootloader
X-Send-Pr-Version: 3.2

>Number:         12850
>Category:       conf
>Synopsis:       an interesting bug in the 3.x series' new i386 bootloader
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    rnordier
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 28 06:10:01 PDT 1999
>Closed-Date:    Wed Jul 28 11:41:28 PDT 1999
>Last-Modified:  Wed Jul 28 11:44:37 PDT 1999
>Originator:     Zahemszky Gabor
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
CoDe Kft.
>Environment:

	

>Description:

	In the file: /usr/src/sys/i386/boot/common/pnp.c, in the pnp_reload
function, at line 108, there is a bug: (by the way, this file hasn't got any
version info, it's on my 3.2-R i386 machine)
the function has only one parameter: the filename, (char *) fname; from which
file we need to reload some information.  In the function, there are three
pnp_readconf() calls, the first two are with constant strings ("/boot/xxx1",
and "/boot/xxx2" - I cannot remember), and the third, with the parameter:
pnp_readconf( fname ).  But in the file, there is:

pnp_readconf( "fname" ).
--------------^-----^
So with it, we cannot use another config file, as the code tested that name:
"fname".  (But on the error report, it reports the normal filename - fname.)

>How-To-Repeat:

	vi /usr/src/sys/i386/boot/common/pnp.c
	108G

>Fix:
	
	substitute "fname" with fname :-)
	f"x;x (a'la vi)

By, Gabor Zahemszky
	ZGabor at CoDe dot HU

-----
#!/bin/ksh
Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z ;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rnordier 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Jul 28 08:29:15 PDT 1999 
Responsible-Changed-Why:  
Assuming that the originator means src/sys/boot/common/pnp.c and not 
src/sys/i386/boot/common/pnp.c, it's fixed in CURRENT but not STABLE. 
I'm assigning this to Robert as an MFC reminder. 
State-Changed-From-To: open->closed 
State-Changed-By: rnordier 
State-Changed-When: Wed Jul 28 11:41:28 PDT 1999 
State-Changed-Why:  
Fixed in -stable: rev 1.7.2.1 of src/sys/boot/common/pnp.c.  Thanks for 
the PR. 
>Unformatted:
