Bug 848230 - Bad matching of filenames containing square brackets during --update
Bad matching of filenames containing square brackets during --update
Status: ASSIGNED
Product: Fedora
Classification: Fedora
Component: tar (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Pavel Raiskup
Fedora Extras Quality Assurance
: FutureFeature, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-14 20:26 EDT by adav84
Modified: 2016-11-24 07:08 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 14:01:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
link to a forum discussion (66 bytes, text/plain)
2012-08-14 20:26 EDT, adav84
no flags Details
Possible fix for bad --update matching. (3.05 KB, text/plain)
2012-08-15 04:44 EDT, Pavel Raiskup
no flags Details

  None (edit)
Description adav84 2012-08-14 20:26:21 EDT
Created attachment 604483 [details]
link to a forum discussion

Description of problem:
tar updates files that 

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

How reproducible:
create a tar archive of a folder that contains some files that have a filename of the form foo[bar]baz, i.e. with square brackets around some component of the filename. observe that on subsequent update with tar uvf..., tar always includes these files in the update, although they haven't changed.

Steps to Reproduce:
$ mkdir zzz
$ touch zzz/foo
$ touch zzz/foo\[bar
$ touch zzz/foo\[bar\]baz
$ tar cvf foo zzz
zzz/
zzz/foo
zzz/foo[bar]baz
zzz/foo[bar
$ tar uvf foo zzz
zzz/foo[bar]baz
$ tar uvf foo zzz
zzz/foo[bar]baz
$ tar uvf foo zzz
zzz/foo[bar]baz

Actual results:
tar adds files anew.

Expected results:
tar shouldn't add files as they haven't changed.

Additional info: this is presumably because tar uses fnmatch() to match the filename with the name stored in the archive entry which fails because the filename is interpreted as a pattern rather that a string literal (see attached forum thread.)
Comment 1 Pavel Raiskup 2012-08-15 04:44:32 EDT
Created attachment 604550 [details]
Possible fix for bad --update matching.

Hi, thanks for the report!

This seems to me that it is an upstream bug also.  It looks that tar does not
handle properly '--wildcards' option while '--update' mode is active.  The
'--wildcards' option is in Fedora turned on by default due to compatibility
reasons.

Easy workaround for you is to use '--no-wildcards' options and the update
process should work for you correctly.

I have attached patch that seems to fix this issue in f17 but I need to consult
this patch with upstream before pushing.  Scratch build for testing will be here
in a moment:

    http://koji.fedoraproject.org/koji/taskinfo?taskID=4391681

Pavel
Comment 2 adav84 2012-08-15 17:07:29 EDT
cool, thanks!
Comment 3 Pavel Raiskup 2012-08-28 07:34:25 EDT
Actually, the --update operation is now really buggy even in upstream (not only
this problem occurs ATM).  I tried to start discussion with upstream on this
topic:

  http://lists.gnu.org/archive/html/bug-tar/2012-08/msg00011.html

Pavel
Comment 4 Fedora End Of Life 2013-07-04 02:27:34 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Pavel Raiskup 2013-07-04 03:10:14 EDT
This is upstream problem, reassigning to Rawhide.
Comment 6 Fedora End Of Life 2013-08-01 14:01:58 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 7 Pavel Raiskup 2013-08-01 14:26:36 EDT
Now really reassigning to Rawhide.
Comment 8 Jan Kurik 2015-07-15 11:04:27 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
Comment 9 Fedora End Of Life 2016-11-24 05:43:21 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

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