bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] possible extraction issue : file named '['


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] possible extraction issue : file named '['
Date: Sun, 21 May 2006 11:29:24 +0300

Paul Eggert <address@hidden> wrote:

> But there's a bigger question here.  I don't see where this behavior
> of GNU tar is documented.  Perhaps I'm missing it, but I just don't
> see it.
> Also, this behavior is incompatible with traditional 'tar',
> and (as your example shows) it makes it difficult to extract arbitrary
> files by name from a tar image.

Yes, you are right: it is not documented. As far as I can tell, you
introduced this behaviour 9 years ago [1]. Unfortunately neither CVS,
nor ChangeLog contain any description of the changes, so one cannot
tell what was the reasoning behind them. The only fact is that GNU
tar behaves this way since 1997 (I guess it was v. 1.12), so changing
this behavior at once is not a good idea. Instead, I'd propose to
introduce some transitional period so that the users be able to
accomodate for the changes.

> My feeling is that the globbing options like --ignore-case and
> --anchored, which currently apply only to --exclude and the like,
> should also apply to ordinary file names on the command line; and that
> the default behavior should be like traditional Unix tar, i.e., no
> globbing.

I agree.
 
> This would be an incompatible change to GNU tar, but it would make GNU
> tar compatible with other tars.  People who like globbing in file
> names would be able to get that behavior by using the --wildcards
> option.

This will also imply changing the default tar settings from --wildcards
(default since at least 2001) to --no-wildcards.

Given all the above, I propose the following:

1. Change the default behavior to strict matching and expand --wildcards
as you propose.
2. Declare a transition period during which tar will display a warning
when it encounters a first file name containing special characters.
Something like 'Pattern matching characters used in file names. Please,
use --wildcards to enable pattern matching, or --no-wildcards to
suppress this warning.'
3. After expiration of the transition period (I guess 1-2 releases will
be quite enough), remove this warning.

Regards,
Sergey

[1] http://cvs.sv.gnu.org/viewcvs/tar/tar/src/names.c?rev=1.6&view=markup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]