Tar fails to --exclude files

Bug #1588690 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU tar
Fix Released
Unknown
tar (Debian)
Fix Released
Unknown
tar (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Hi,
this is a regression in tar 1.28-2.1 -> 1.29-1 and by that it is valid for Xenial -> Yakkety, but as well for Debian Stretch.

Fortunately there is at least a simple test:
rm -rf dir; mkdir -p dir/subdir; touch dir/subdir/file; tar -c -f /tmp/test.tar -C dir subdir --exclude subdir/file; tar -tf /tmp/test.tar subdir/file

Correct:
tar: subdir/file: Not found in archive
tar: Exiting with failure status due to previous errors

Wrong:
subdir/file

This could cause quite a few weird/under-the-radar bugs all around - like in my package which suddenly had more binaries. "Fortunately" one of them collided with one of the system, so we found this issue.

I'll report to Debian as well and link the bug.

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: tar 1.29-1
ProcVersionSignature: Ubuntu 4.4.0-23.41-generic 4.4.10
Uname: Linux 4.4.0-23-generic x86_64
ApportVersion: 2.20.1-0ubuntu4
Architecture: amd64
Date: Fri Jun 3 09:46:54 2016
InstallationDate: Installed on 2016-06-01 (1 days ago)
InstallationMedia: Ubuntu-Server 16.10 "Yakkety Yak" - Alpha amd64 (20160601)
SourcePackage: tar
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Changed in tar (Debian):
status: Unknown → New
Scott Moser (smoser)
Changed in tar (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

See related discussions:
http://lists.gnu.org/archive/html/bug-tar/2016-05/msg00012.html
http://lists.gnu.org/archive/html/bug-tar/2016-06/msg00014.html

TL;DR:
In reference to my testcase:
BAD:
tar -c -f /tmp/test.tar -C dir subdir --exclude subdir/file
FIXED:
tar -c -f /tmp/test.tar -C dir --exclude subdir/file subdir

Clarifying last bits with upstream, but this probably is a regression for everybody who used it wrong (like me) in the past.

Changed in tar:
status: Unknown → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is in fact now the way it always should have been.
So not a bug in tar, but if any in the code using tar.
... closing

Changed in tar (Ubuntu):
status: Confirmed → Invalid
Changed in tar (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.