From kjm@ideon.st.ryukoku.ac.jp  Wed Jan  5 00:08:05 2000
Return-Path: <kjm@ideon.st.ryukoku.ac.jp>
Received: from rins.st.ryukoku.ac.jp (rins.st.ryukoku.ac.jp [133.83.4.1])
	by hub.freebsd.org (Postfix) with ESMTP id 11D9814E0E
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Jan 2000 00:07:56 -0800 (PST)
	(envelope-from kjm@ideon.st.ryukoku.ac.jp)
Received: from ideon.st.ryukoku.ac.jp (ideon.st.ryukoku.ac.jp [133.83.36.5])
	by rins.st.ryukoku.ac.jp (8.9.3+3.2W/3.7W/RINS-1.9.6-NOSPAM) with ESMTP id RAA21805
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 5 Jan 2000 17:07:50 +0900 (JST)
Received: (from kjm@localhost)
	by ideon.st.ryukoku.ac.jp (8.9.3/3.7W/kjm-19990628) id RAA60396;
	Wed, 5 Jan 2000 17:07:50 +0900 (JST)
Message-Id: <200001050807.RAA60396@ideon.st.ryukoku.ac.jp>
Date: Wed, 5 Jan 2000 17:07:50 +0900 (JST)
From: kjm@rins.ryukoku.ac.jp
Sender: kjm@ideon.st.ryukoku.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: vi tmpfile recovery script bug (from BUGTRAQ)
X-Send-Pr-Version: 3.2

>Number:         15901
>Category:       conf
>Synopsis:       vi tmpfile recovery script (/etc/rc) cannot handle space-containded-filename.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan  5 00:10:01 PST 2000
>Closed-Date:    Mon Jan 10 05:31:35 PST 2000
>Last-Modified:  Mon Jan 10 05:32:13 PST 2000
>Originator:     KOJIMA Hajime
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
Ryukoku University
>Environment:

	N/A

>Description:

	Vi tmpfile recovery script (a part of /etc/rc) cannot handle
	space-containded-filename correctly.  

>How-To-Repeat:

	See BUGTRAQ posting

<http://www.securityfocus.com/templates/archive.pike?list=1&date=1999-12-29&msg=19991231143208.94AD11F5E8@lists.securityfocus.com>

	for more detail.

>Fix:

	for FreeBSD-current:

--- branches/-current/src/etc/rc	Mon Dec 27 20:11:10 1999
+++ rc	Wed Jan  5 16:45:27 2000
@@ -442,7 +442,7 @@
 		# Unmodified nvi editor backup files either have the
 		# execute bit set or are zero length.  Delete them.
 		if [ -x "${i}" -o ! -s "${i}" ]; then
-			rm -f ${i}
+			rm -f "${i}"
 		fi
 	done
 
@@ -461,9 +461,9 @@
 			# Else send mail to the user.
 			recfile=`awk '/^X-vi-recover-path:/{print $2}' < ${i}`
 			if [ -n "${recfile}" -a -s "${recfile}" ]; then
-				sendmail -t < ${i}
+				sendmail -t < "${i}"
 			else
-				rm -f ${i}
+				rm -f "${i}"
 			fi
 		done
 	fi

----
KOJIMA Hajime - Ryukoku University, Seta, Ootsu, Shiga, 520-2194 Japan
[Office] kjm@rins.ryukoku.ac.jp, http://www.st.ryukoku.ac.jp/~kjm/

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phantom 
State-Changed-When: Mon Jan 10 05:31:35 PST 2000 
State-Changed-Why:  
Fixed by peter few days ago 
>Unformatted:
