Bug 408621

Summary: tar -vf /dev/stdout produces corrupted tar archives
Product: [Fedora] Fedora Reporter: Alexander Todorov <atodorov>
Component: tarAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: tar-1.17-5.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-26 16:57:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Todorov 2007-12-03 13:52:27 UTC
Description of problem:
When using -v (verbose) and -f (output file) options and specifying /dev/stdout
as argument tar produces corrupted archive.

Version-Release number of selected component (if applicable):
tar (GNU tar) 1.15.1
tar-1.15.1-23.0.1.el5

How reproducible:
Always

Steps to Reproduce:
1. tar -cvf /dev/stdout [files or dirs] > output.tar
  
Actual results:
resulting file is not a valid tar archive. the file listing is mixed with actual
content.

Expected results:


Additional info:
Long description of the problem:
http://www.redhatmagazine.com/2007/10/24/tips-from-an-rhce-splitting-tar-archives-on-the-fly/#comment-36513

When using -f file listing is printed on stdout. Tar is not checking if the
argument to -f is "/dev/stdout". When not using -f standard output is assumed by
default and tar will send file listing to stderr.

That's bug either in code or documentation. I haven't seen manual page
indicating that -v and -f may lead to corrupted archives. The "-f /dev/stdout"
is not really necessary but it's used to make the command more human friendly.

Comment 2 RHEL Program Management 2007-12-03 20:48:06 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release.  This request will
be reviewed for a future Red Hat Enterprise Linux release.

Comment 8 Bug Zapper 2008-05-14 04:04:41 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Ondrej Vasik 2008-05-26 16:57:45 UTC
As I'm new tar maintainer - and as the fixed manpage is part of F9/Rawhide tar,
closing that bugzilla RAWHIDE. Feel free to add any comments if you have
something to discuss about that issue.