From dcs@newsguy.com  Fri Jan 29 03:23:09 1999
Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA02426
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Jan 1999 03:23:07 -0800 (PST)
          (envelope-from dcs@newsguy.com)
Received: from daniel.sobral by peach.ocn.ne.jp (8.9.1a/OCN) id UAA15851; Fri, 29 Jan 1999 20:23:04 +0900 (JST)
Received: (from root@localhost)
	by daniel.sobral (8.9.1/8.9.2) id UAA00382;
	Fri, 29 Jan 1999 20:21:51 +0900 (JST)
	(envelope-from root)
Message-Id: <199901291121.UAA00382@daniel.sobral>
Date: Fri, 29 Jan 1999 20:21:51 +0900 (JST)
From: dcs@newsguy.com
Reply-To: dcs@newsguy.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: ficlExecFD wants to eat the cake and have it at the same time
X-Send-Pr-Version: 3.2

>Number:         9772
>Category:       bin
>Synopsis:       ficlExecFD vmThrows error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 29 03:30:01 PST 1999
>Closed-Date:    Thu Feb 4 05:29:40 PST 1999
>Last-Modified:  Thu Feb  4 05:29:59 PST 1999
>Originator:     Daniel C. Sobral
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

	Current as of Jan 24

>Description:

	ficlExecFD says it will return either VM_OUTOFTEXT or the
appropriate error code, but then goes and vmThrows any error. Worse yet,
there is no garantee that ficlExecFD was called from inside a ficlExec
"safety net" to catch the vmThrow. In fact, the only place currently
calling ficlExecFD in all source code is garantee not to be inside a
ficlExec execution instance... :-)

>How-To-Repeat:

	Copy a file with error to /boot/boot.4th and reboot

>Fix:
	
	Apply the following fix:


--- src/sys/boot/ficl/ficl.c	1999/01/28 17:01:53	1.12
+++ src/sys/boot/ficl/ficl.c	1999/01/29 11:14:44
@@ -377,8 +377,7 @@
 	if(rval != VM_QUIT && rval != VM_USEREXIT && rval != VM_OUTOFTEXT)
         {
             pVM->sourceID = id;
-            vmThrowErr(pVM, "ficlExecFD: Error at line %d", nLine);
-            break; 
+            return rval; 
         }
     }
     /*
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dcs 
State-Changed-When: Thu Feb 4 05:29:40 PST 1999 
State-Changed-Why:  
Committed. 
>Unformatted:
