Bug 15901

Summary: vi tmpfile recovery script (/etc/rc) cannot handle space-containded-filename.
Product: Base System Reporter: KOJIMA Hajime <kjm>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description KOJIMA Hajime 2000-01-05 08:10:01 UTC
	Vi tmpfile recovery script (a part of /etc/rc) cannot handle
	space-containded-filename correctly.

Fix: for FreeBSD-current:



----
KOJIMA Hajime - Ryukoku University, Seta, Ootsu, Shiga, 520-2194 Japan
[Office] kjm@rins.ryukoku.ac.jp, http://www.st.ryukoku.ac.jp/~kjm/--ltKrixJRNwHLbdOZdwunF2nzcZjY1eWD9Nxajilvh6zTMcAN
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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
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.
Comment 1 Alexey Zelkin freebsd_committer freebsd_triage 2000-01-10 13:31:35 UTC
State Changed
From-To: open->closed

Fixed by peter few days ago