Bug 848230 - Bad matching of filenames containing square brackets during --update
Summary: Bad matching of filenames containing square brackets during --update
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: tar
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Dubaj
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-15 00:26 UTC by adav84
Modified: 2021-10-07 07:15 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-07 07:15:38 UTC
Type: Bug
Embargoed:


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

Description adav84 2012-08-15 00:26:21 UTC
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 08:44:32 UTC
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 21:07:29 UTC
cool, thanks!

Comment 3 Pavel Raiskup 2012-08-28 11:34:25 UTC
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 06:27:34 UTC
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 07:10:14 UTC
This is upstream problem, reassigning to Rawhide.

Comment 6 Fedora End Of Life 2013-08-01 18:01:58 UTC
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 18:26:36 UTC
Now really reassigning to Rawhide.

Comment 8 Jan Kurik 2015-07-15 15:04:27 UTC
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 10:43:21 UTC
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.

Comment 10 Ondrej Dubaj 2021-10-07 07:15:38 UTC
According to the low priority of this request and as it did not bother any user for years, I am closing this tracker. If you think this issue should be handled and investigated, feel free to reopen it.


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