Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Mar 2008 15:40:03 GMT
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/121502: option -P appears to be broken in restore(8) since FreeBSD 6.3 (regression)
Message-ID:  <200803241540.m2OFe3lO016598@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/121502; it has been noted by GNATS.

From: Jaakko Heinonen <jh@saunalahti.fi>
To: Derek =?utf-8?B?S3VsacWEc2tp?= <takeda@takeda.tk>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/121502: option -P appears to be broken in restore(8) since
	FreeBSD 6.3 (regression)
Date: Mon, 24 Mar 2008 17:35:23 +0200

 --Q68bSM7Ycu6FN28Q
 Content-Type: text/plain; charset=utf-8
 Content-Disposition: inline
 Content-Transfer-Encoding: 8bit
 
 On 2008-03-23, Derek KuliƄski wrote:
 > I would never thought that gzip was to blame for that...
 
 Although this not a regression in restore(8) I think it's a bug in it.
 restore(8) has a special block reading code for pipes. This code handles
 short reads from pipes. However the code is only enabled if your source
 file name is "-" (stdin) not when you use the -P switch.
 
 Could you try the attached patch which enables the special handling for
 pipes when using the -P switch?
 
 -- 
 Jaakko
 
 --Q68bSM7Ycu6FN28Q
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="restore-pipeincmd-as-pipe.diff"
 
 Index: tape.c
 ===================================================================
 RCS file: /home/ncvs/src/sbin/restore/tape.c,v
 retrieving revision 1.49
 diff -p -u -r1.49 tape.c
 --- tape.c	6 Mar 2007 08:13:20 -0000	1.49
 +++ tape.c	24 Mar 2008 10:51:49 -0000
 @@ -134,9 +134,10 @@ setinput(char *source, int ispipecommand
  		newtapebuf(NTREC > HIGHDENSITYTREC ? NTREC : HIGHDENSITYTREC);
  	terminal = stdin;
  
 -	if (ispipecommand)
 +	if (ispipecommand) {
  		pipecmdin++;
 -	else
 +		pipein++;
 +	} else
  #ifdef RRESTORE
  	if (strchr(source, ':')) {
  		host = source;
 
 --Q68bSM7Ycu6FN28Q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803241540.m2OFe3lO016598>