Bug 30876

Summary: tar ignores complaints from gzip
Product: Base System Reporter: Simon J. Gerraty <sjg>
Component: gnuAssignee: Maxim Sobolev <sobomax>
Status: Closed FIXED    
Severity: Affects Only Me CC: bug-tar
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Simon J. Gerraty 2001-09-27 19:40:04 UTC
	
The patch below fixes a couple of issues with how tar interacts with
its child - gzip.

1. When the child (gzip) exists with a bad status, tar reports it but does
   not propagate the failure to its caller.  This has lead to pkg_add
   attempting to install corrupted binaries when a gzip fails CRC checks
   but tar has read the end of archive marker before gzip exits.

   Tar should never ignore a bad exit status from its child.


2. Tar closes the pipe as soon as it reads the end of archive.
   It understands that this might result in its child dying due to SIGPIPE
   and it ignores that condition.
   However, if the child catches SIGPIPE and just exit's 1, the fix above
   will result in an unnecessary failure.

   Tar should read EOF from the child before closing the pipe.

--sjg

Fix: I can't get a connection to anoncvs.freebsd.org, but the following patch
applies cleanly to -current.
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2002-05-09 22:39:02 UTC
State Changed
From-To: open->closed

Fixed in rev 1.5 (MFC 1.2.12.1) of src/gnu/usr.bin/tar/buffer.c 



Comment 2 Johan Karlsson freebsd_committer freebsd_triage 2002-05-09 22:39:02 UTC
Responsible Changed
From-To: freebsd-bugs->sobomax

Maxim commited this fix.