Bug 81158 - tar --delete removes files that haven't been specified
tar --delete removes files that haven't been specified
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: tar (Show other bugs)
9
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Martin Stransky
Ben Levenson
:
: 84919 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-06 06:10 EST by Martin Hejl
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-20 04:16:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Script to reproduce the bug (1.30 KB, text/plain)
2003-01-06 06:12 EST, Martin Hejl
no flags Details

  None (edit)
Description Martin Hejl 2003-01-06 06:10:35 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

Description of problem:
issuing 'tar -f archive.tar --delete somefilename' removes files at the end of
the archive if the archive contains zero length files or symbolic links and
"somefilename" is not contained in the archive

Version-Release number of selected component (if applicable):
tar-1.13.25-4.7.1

How reproducible:
Always

Steps to Reproduce:
1. create a sample archive
dd if=/dev/zero of=file1 bs=1024 count=9 2>/dev/null
echo file2_contents >file2					
# Create empty file - that's the key. if no size 0 files (or symbolic links) 
# are in the archive, everything works as expected
# alternatively we could use 'ln -s file2 file3' here
touch file3

# Make sure the size 0 file is not at the end of the archive
dd if=/dev/zero of=file4 bs=1024 count=1 2>/dev/null
tar cf test.tar file1 file2 file3 file4

2. save the file listing 
tar tf test.tar > before

3. try to delete a file that doesn't exist in the archive (this corrupts the
archive)
tar --delete -f test.tar file_does_not_exist

4. save the file listing after corruption
tar tf test.tar > after

5. show the differences
diff before after


Actual Results:  file "before" and "after" differ

Expected Results:  file "before" and "after" should be identical

Additional info:

Bug can also be reproduced on 7.2 and phoebe
Comment 1 Martin Hejl 2003-01-06 06:12:35 EST
Created attachment 89150 [details]
Script to reproduce the bug
Comment 2 Jeff Johnson 2003-02-24 21:41:41 EST
*** Bug 84919 has been marked as a duplicate of this bug. ***
Comment 3 Martin Hejl 2003-11-14 16:10:46 EST
applies to Fedora Core release 1 (Yarrow) as well (tar-1.13.25-12)

Note You need to log in before you can comment on or make changes to this bug.