After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559481 - Can't open/view file directly from File Roller if there is a bracket in the directory/file name
Can't open/view file directly from File Roller if there is a bracket in the d...
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
file-roller-maint
: 566066 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-05 18:04 UTC by Pedro Villavicencio
Modified: 2008-12-31 11:16 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch for zip extract file and delete file wildcard bug (1.83 KB, patch)
2008-12-20 21:28 UTC, Gerard Lommerse
none Details | Review

Description Pedro Villavicencio 2008-11-05 18:04:41 UTC
this bug has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/file-roller/+bug/294215

"Try open the ZIP file attached with File Roller (AKA Archive Manager). In my case
I can't open/view directly if there is square brackets on the directory/file name. It
gives me error message like this:
> caution: filename not matched: aaa[aaa].txt
There is no problem when extracting the entire file's content though.

I have the same file but in RAR and there is no problem at all."

file to test: http://launchpadlibrarian.net/19392225/file-roller-zip-bug.zip
Comment 1 Patrick Walton 2008-11-29 05:49:02 UTC
Same here.

An error occurred while extracting files.

(null)

caution: filename not matched:  Super Metroid (JU) [!].smc

1 archive had fatal errors.
Comment 2 Gerard Lommerse 2008-12-20 17:38:46 UTC
It seems that file-roller sends the matching filename unmodified to unzip.

However, unzip allows for wildcards in the matching name and as such applies special meaning to the characters "[]*?!^-\".

The special meaning for these characters can be suppressed by preceding each of these special characters with the '\' (backslash) character. This probably requires special processing of the file_list parameter in e.g. fr_command_zip_extract (requires a special zip-purpose 'fr_process_add_arg' that correctly escapes the special characters in the argument before calling fr_process_add_arg?).

For more information on the special characters, see comment from unzip "match.c" file:

     `*' matches any sequence of characters (zero or more)
     `?' matches any single character
     [SET] matches any character in the specified set,
     [!SET] or [^SET] matches any character not in the specified set.

  A set is composed of characters or ranges; a range looks like ``character
  hyphen character'' (as in 0-9 or A-Z).  [0-9a-zA-Z_] is the minimal set of
  characters allowed in the [..] pattern construct.  Other characters are
  allowed (i.e., 8-bit characters) if your system will support them.

  To suppress the special syntactic significance of any of ``[]*?!^-\'', in-
  side or outside a [..] construct, and match the character exactly, precede
  it with a ``\'' (backslash).

  Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is
  defined.  See the DOSWILD section below for an explanation.  Note also
  that with VMSWILD defined, '%' is used instead of '?', and sets (ranges)
  are delimited by () instead of [].
Comment 3 Gerard Lommerse 2008-12-20 21:28:11 UTC
Created attachment 125067 [details] [review]
Patch for zip extract file and delete file wildcard bug
Comment 4 Gerard Lommerse 2008-12-21 09:19:15 UTC
Note that the attached patch assumes file-roller interfaces with Info-ZIP's zip and unzip (I used Ubuntu 8.10). I think this might not always be the case for all platforms, or even for all linux ditributions. So the patch might need some additional work to be sure it still works on all platforms/distributions.
Comment 5 Paolo Bacchilega 2008-12-21 10:27:58 UTC
this problem only occurs with the zip/unzip utilities, if you install 7zip file-roller will use 7zip to open zip files and the problem doesn't occur anymore.  7zip is the file-roller preferred utility to handle zip files.
Comment 6 Paolo Bacchilega 2008-12-21 11:11:41 UTC
patch applied to current trunk, thanks.
Comment 7 Paolo Bacchilega 2008-12-31 11:16:36 UTC
*** Bug 566066 has been marked as a duplicate of this bug. ***