From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 24 15:40:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94DFF106566B for ; Mon, 24 Mar 2008 15:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 764D38FC13 for ; Mon, 24 Mar 2008 15:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2OFe3ZX016599 for ; Mon, 24 Mar 2008 15:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2OFe3lO016598; Mon, 24 Mar 2008 15:40:03 GMT (envelope-from gnats) Date: Mon, 24 Mar 2008 15:40:03 GMT Message-Id: <200803241540.m2OFe3lO016598@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: bin/121502: option -P appears to be broken in restore(8) since FreeBSD 6.3 (regression) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2008 15:40:03 -0000 The following reply was made to PR bin/121502; it has been noted by GNATS. From: Jaakko Heinonen To: Derek =?utf-8?B?S3VsacWEc2tp?= 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--