From roam@orbitel.bg  Thu Nov  2 11:03:50 2000
Return-Path: <roam@orbitel.bg>
Received: from ringworld.oblivion.bg (ringworld.nanolink.com [195.24.48.13])
	by hub.freebsd.org (Postfix) with SMTP id 9E42B37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Nov 2000 11:03:49 -0800 (PST)
Received: (qmail 435 invoked by uid 0); 2 Nov 2000 19:03:29 -0000
Message-Id: <20001102190329.434.qmail@ringworld.oblivion.bg>
Date: 2 Nov 2000 19:03:29 -0000
From: Peter Pentchev <roam@orbitel.bg>
Reply-To: Peter Pentchev <roam@orbitel.bg>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] fix broken rc.shutdown $oldscripts check
X-Send-Pr-Version: 3.2

>Number:         22548
>Category:       conf
>Synopsis:       [PATCH] fix broken rc.shutdown $oldscripts check
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 02 11:10:01 PST 2000
>Closed-Date:    Thu Nov 2 11:25:18 PST 2000
>Last-Modified:  Thu Nov  2 11:40:02 PST 2000
>Originator:     Peter Pentchev
>Release:        FreeBSD 4.2-BETA i386
>Organization:
Orbitel JSCo.
>Environment:

RELENG_4, -current too.

>Description:

The recently added $oldscripts check in /etc/rc.shutdown is just a bit
off the mark - the very last test fails if there is more than one
old-style script, or none at all.

All the other tests have the shell variable arguments quoted, just
the last one is missing the quotes; /bin/[ then thinks it is being
invoked with more than two arguments, tries to interpret the second
argument as an operator, and fails, because it is actually the name
of the first old-style script.

>How-To-Repeat:

shutdown now on a box with more than one old-style script.

>Fix:

--- src/etc/rc.shutdown	Mon Oct 30 15:56:29 2000
+++ mysrc/etc/rc.shutdown	Thu Nov  2 20:54:41 2000
@@ -81,7 +81,7 @@
 			done
 		fi
 	done
-	if [ ! -z ${oldscripts} ]; then
+	if [ ! -z "${oldscripts}" ]; then
 		echo 'You still seem to have old-style rc.d scripts:'
 		echo ${oldscripts}
 		echo 'Please change them to recognize the "stop" option.'

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Nov 2 11:13:52 PST 2000 
Responsible-Changed-Why:  
You're dead right; quoting variables was part of the new style  
introduced by Doug Barton ages ago. 

I'll fix it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22548 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Thu Nov 2 11:25:18 PST 2000 
State-Changed-Why:  
Fixed in rev 1.4.2.4, since this would have been a real bitch 
for 4.2-RELEASE.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22548 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Peter Pentchev <roam@orbitel.bg>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/22548: [PATCH] fix broken rc.shutdown $oldscripts check 
Date: Thu, 02 Nov 2000 21:29:33 +0200

 On 02 Nov 2000 19:03:29 GMT, Peter Pentchev wrote:
 
 > RELENG_4, -current too.
 
 By the way, I'm pretty sure this is _not_ a problem in -CURRENT.
 Double-check? :-)
 
 Ciao,
 Sheldon.
 

From: Peter Pentchev <roam@orbitel.bg>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/22548: [PATCH] fix broken rc.shutdown $oldscripts check
Date: Thu, 2 Nov 2000 21:37:22 +0200

 On Thu, Nov 02, 2000 at 09:29:33PM +0200, Sheldon Hearn wrote:
 > 
 > 
 > On 02 Nov 2000 19:03:29 GMT, Peter Pentchev wrote:
 > 
 > > RELENG_4, -current too.
 > 
 > By the way, I'm pretty sure this is _not_ a problem in -CURRENT.
 > Double-check? :-)
 
 Errrrrrr...  *Oof*. (that makes TWO of those for today; at least
 this PR did have *some* sense in it, unlike bin/22545).
 
 Of course you're right.  Serves me right for trying to think ;)
 
 G'luck,
 Peter
 
 -- 
 No language can express every thought unambiguously, least of all this one.
 
>Unformatted:
