From nobody@FreeBSD.ORG  Thu Jan  6 02:42:31 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id A504015078; Thu,  6 Jan 2000 02:42:31 -0800 (PST)
Message-Id: <20000106104231.A504015078@hub.freebsd.org>
Date: Thu,  6 Jan 2000 02:42:31 -0800 (PST)
From: y-koga@jp.FreeBSD.org
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: vi recover script in /etc/rc still remains unsolved.
X-Send-Pr-Version: www-1.0

>Number:         15937
>Category:       conf
>Synopsis:       vi recover script in /etc/rc still remains unsolved.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan  6 02:50:02 PST 2000
>Closed-Date:    Sun Jun 4 15:10:19 PDT 2000
>Last-Modified:  Sun Jun 04 15:11:08 PDT 2000
>Originator:     Koga Youichirou
>Release:        2.2.8-STABLE, 3.4-RELEASE, and current
>Organization:
The FreeBSD Project (Japan)
>Environment:
>Description:
About vi recover script in /etc/rc, this problem has been submitted by Mr. Kojima
and Peter has committed already, but it still remains unsolved.

Quoting filename(s) does not make sence, because it is splitted by space before then.

>How-To-Repeat:
case a) /foo is executable and user root can rm -f /foo: 
% echo a > '/var/tmp/vi.recover/vi. foo'

case b) user root can rm -f /foo: 
% touch /var/tmp/vi.recover/recover. foo'

>Fix:
a) Change the working directory to /var/tmp/vi.recover or use full path, and
it can't remove a file "/foo". However, it is no more than a temporary step.

b) Use "ls" and replace white spaces with some charcters.
   e.g.)
	SPACE => /s
	TAB => /t
then restore as before and quote word(s) in "for" block.


Probably there are better solutions than above.


>Release-Note:
>Audit-Trail:

From: Peter Wemm <peter@netplex.com.au>
To: y-koga@jp.FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/15937: vi recover script in /etc/rc still remains unsolved. 
Date: Thu, 06 Jan 2000 19:14:38 +0800

 y-koga@jp.FreeBSD.org wrote:
 
 > >Description:
 > About vi recover script in /etc/rc, this problem has been submitted by Mr. Ko
     jima
 > and Peter has committed already, but it still remains unsolved.
 > 
 > Quoting filename(s) does not make sence, because it is splitted by space befo
     re then.
 
 Can you please check a patch along these lines?  This stops the split in the
 first place.
 
 Index: rc
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc,v
 retrieving revision 1.207
 diff -u -r1.207 rc
 --- rc	2000/01/05 09:19:27	1.207
 +++ rc	2000/01/06 11:13:26
 @@ -433,7 +433,7 @@
  vibackup=`echo /var/tmp/vi.recover/vi.*`
  if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
  	echo 'Recovering vi editor sessions'
 -	for i in ${vibackup}; do
 +	for i in /var/tmp/vi.recover/vi.*; do
  		# Only test files that are readable.
  		if [ ! -r "${i}" ]; then
  			continue
 @@ -450,7 +450,7 @@
  	# crashes at the right time.
  	virecovery=`echo /var/tmp/vi.recover/recover.*`
  	if [ "${virecovery}" != "/var/tmp/vi.recover/recover.*" ]; then
 -		for i in ${virecovery}; do
 +		for i in /var/tmp/vi.recover/recover.*; do
  			# Only test files that are readable.
  			if [ ! -r "${i}" ]; then
  				continue
 
 
 
 Cheers,
 -Peter
 
 

From: Koga Youichirou <y-koga@jp.FreeBSD.org>
To: peter@netplex.com.au
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/15937: vi recover script in /etc/rc still remains
 unsolved. 
Date: Thu, 06 Jan 2000 20:21:10 +0900 (JST)

 Peter Wemm <peter@netplex.com.au>:
 > Can you please check a patch along these lines?  This stops the split in the
 > first place.
 
 It seems to work successfully.
 
 -- Koga, Youichirou
 
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: phantom 
Responsible-Changed-When: Mon Jan 10 05:11:45 PST 2000 
Responsible-Changed-Why:  
Peter proposed patch and he will close PR. 
State-Changed-From-To: open->closed 
State-Changed-By: nrahlstr 
State-Changed-When: Sun Jun 4 15:10:19 PDT 2000 
State-Changed-Why:  
Peter fixed this in revision 1.208 of etc/rc. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=15937 
>Unformatted:
