RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1184697 - RHEL7 tar doesn't restore incremental backup correctly.
Summary: RHEL7 tar doesn't restore incremental backup correctly.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tar
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Repik
QA Contact: Robin Hack
Lenka Kimlickova
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1393868 1400961
TreeView+ depends on / blocked
 
Reported: 2015-01-22 03:46 UTC by kyoneyama
Modified: 2019-02-15 14:03 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
"tar" now restores incremental backup correctly Previously, the "tar" command did not restore incremental backup correctly. Consequently, a file removed in the incremental backup was not removed when restoring. The bug has been fixed, and "tar" now restores incremental backup correctly.
Clone Of:
Environment:
Last Closed: 2017-08-01 17:01:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
backpatched fix (11.26 KB, patch)
2015-02-09 12:41 UTC, Pavel Raiskup
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2012 0 normal SHIPPED_LIVE tar bug fix update 2017-08-01 18:01:19 UTC

Description kyoneyama 2015-01-22 03:46:35 UTC
Description of problem:

When RHEL7 tar restoring incremental backup, it doesn't remove a file that removed from previous backup.


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

  tar-1.26-29.el7

How reproducible:

  Always

Steps to Reproduce:

1. Get files ready for archive.

  # pwd
  /var/tmp
  # ls tmp
  1.txt  2.txt

2. Creating a full backup archive.

  # tar Jcfg file.tar.xz file.snar tmp
  # tar Jtf file.tar.xz 
  tmp/
  tmp/1.txt
  tmp/2.txt

2. Creating an incremental backup archive.

  # echo 3 > tmp/3.txt
  # rm tmp/2.txt
  # tar Jcfg file2.tar.xz file.snar tmp

3. Restore files from full backup archive.

  # mkdir file
  # tar JxfCg file.tar.xz ./file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/2.txt

4. Restore files from incremental backup archive.

  # tar JxfCg file2.tar.xz file/ file.snar


Actual results:

RHEL7 tar does not remove file "2.txt".

  # tar JxfCg file2.tar.xz file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/2.txt
  file/tmp/3.txt


Expected results:

tar can remove file "2.txt" like RHEL6.

  # tar JxfCg file2.tar.xz file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/3.txt

Comment 2 Pavel Raiskup 2015-02-09 10:09:47 UTC
Thanks for the report and sorry for the delay.  Yes, that was/is bug in
upstream release 1.26, fixed in 1.27 by upstream commit:

  http://git.savannah.gnu.org/cgit/tar.git/commit/?id=738fb9c2f44e

More concretely, it is a bug in -C option (not the first one relevant to *at()
change).  You can work-around that by wrapping tar into 'cd file/' and 'cd -',
the following example should work for your concrete example:

  Old command:
     $ tar JxfCg file.tar.xz ./file/ file.snar

  New cmomands:

     $ cd file \
     && tar Jxfg ../file.tar.xz ../file.snar \
     && cd -

Pavel

Comment 3 Pavel Raiskup 2015-02-09 12:41:07 UTC
Created attachment 989672 [details]
backpatched fix

Comment 4 Pavel Raiskup 2016-08-25 11:08:43 UTC
I see the customer case is closed now, and I don't know whether this is still
expected to be fixed (and I'm considering closing this bug).

Was the workaround helpful so we don't need to have this fixed?

Comment 6 Karel Volný 2016-12-01 08:42:45 UTC
(In reply to Pavel Raiskup from comment #4)
> I see the customer case is closed now, and I don't know whether this is still
> expected to be fixed (and I'm considering closing this bug).
> 
> Was the workaround helpful so we don't need to have this fixed?

IMHO we should fix this anyways, this is minimal effort as tar will have an erratum anyways, the patch is ready and there's complete reproducer available for QA

Comment 15 errata-xmlrpc 2017-08-01 17:01:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2012


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