[Bug 1081362] [NEW] unzip extracts directories as files

ajhcasual 1081362 at bugs.launchpad.net
Tue Nov 20 23:16:27 UTC 2012


Public bug reported:

Very similar to https://bugs.launchpad.net/bugs/147866

Extracting a zip archive, unzip creates empty files instead of
directories, when the listing does not contain trailing slash.

Interestingly,  file-roller does work when extracting from archives like
this.  I only encountered it now when trying to unzip from the command
line.

Here is the zipinfo listing for a zip file that will cause the bug to occur:
-----------------------------------------------------------------------------------------------
$ unzip -Z archive.zip 

Archive:  archive.zip
Zip file size: 264266 bytes, number of entries: 10
drwx---     2.0 fat        0 b- stor 07-Dec-31 21:47 directory01
drwx---     2.0 fat        0 b- stor 07-Dec-19 15:32 directory02/
drwx---     3.1 fat        0 bx stor 12-Oct-10 14:37 directory02/subdir02a
drwx---     3.1 fat        0 bx stor 12-Oct-10 14:30 directory02/subdir02a/subdir02b
-rw-a--     3.1 fat      196 bx defN 12-Oct-23 17:27 directory01/file01
-rw-a--     3.1 fat     5812 bx defN 12-Oct-23 17:29 directory02/subdir02a/subdir02b/file02a
-rw-a--     3.1 fat    59903 bx defN 06-Oct-28 13:45 directory02/subdir02a/subdir02b/file02b
-rw-a--     3.1 fat    42594 bx defN 06-Oct-28 14:19 directory02/subdir02a/subdir02b/file02c
-rw-a--     3.1 fat     7892 bx defN 06-Oct-26 16:30 directory02/subdir02a/subdir02b/file02d
-rw-a--     3.1 fat  1118990 bx defN 12-Oct-23 17:31 directory02/subdir02a/subdir02b/file02e
10 files, 1235387 bytes uncompressed, 262670 bytes compressed:  78.7%
-----------------------------------------------------------------------------------------------

And the error messages:
-----------------------------------------------------------------------------------------------
$ unzip archive.zip -d  /tmp/

Archive:  archive.zip
 extracting: /tmp/directory01
   creating: /tmp/directory02/
 extracting: /tmp/directory02/subdir02a
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b.
checkdir error:  /tmp/directory01 exists but is not directory
                 unable to process directory01/file01.
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b/file02a.
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b/file02b.
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b/file02c.
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b/file02d.
checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                 unable to process directory02/subdir02a/subdir02b/file02e.

-----------------------------------------------------------------------------------------------


Version info:

$ unzip --help

UnZip 6.00 of 20 April 2009, by Debian.

** Affects: unzip (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unzip in Ubuntu.
https://bugs.launchpad.net/bugs/1081362

Title:
  unzip extracts directories as files

Status in “unzip” package in Ubuntu:
  New

Bug description:
  Very similar to https://bugs.launchpad.net/bugs/147866

  Extracting a zip archive, unzip creates empty files instead of
  directories, when the listing does not contain trailing slash.

  Interestingly,  file-roller does work when extracting from archives
  like this.  I only encountered it now when trying to unzip from the
  command line.

  Here is the zipinfo listing for a zip file that will cause the bug to occur:
  -----------------------------------------------------------------------------------------------
  $ unzip -Z archive.zip 

  Archive:  archive.zip
  Zip file size: 264266 bytes, number of entries: 10
  drwx---     2.0 fat        0 b- stor 07-Dec-31 21:47 directory01
  drwx---     2.0 fat        0 b- stor 07-Dec-19 15:32 directory02/
  drwx---     3.1 fat        0 bx stor 12-Oct-10 14:37 directory02/subdir02a
  drwx---     3.1 fat        0 bx stor 12-Oct-10 14:30 directory02/subdir02a/subdir02b
  -rw-a--     3.1 fat      196 bx defN 12-Oct-23 17:27 directory01/file01
  -rw-a--     3.1 fat     5812 bx defN 12-Oct-23 17:29 directory02/subdir02a/subdir02b/file02a
  -rw-a--     3.1 fat    59903 bx defN 06-Oct-28 13:45 directory02/subdir02a/subdir02b/file02b
  -rw-a--     3.1 fat    42594 bx defN 06-Oct-28 14:19 directory02/subdir02a/subdir02b/file02c
  -rw-a--     3.1 fat     7892 bx defN 06-Oct-26 16:30 directory02/subdir02a/subdir02b/file02d
  -rw-a--     3.1 fat  1118990 bx defN 12-Oct-23 17:31 directory02/subdir02a/subdir02b/file02e
  10 files, 1235387 bytes uncompressed, 262670 bytes compressed:  78.7%
  -----------------------------------------------------------------------------------------------

  And the error messages:
  -----------------------------------------------------------------------------------------------
  $ unzip archive.zip -d  /tmp/

  Archive:  archive.zip
   extracting: /tmp/directory01
     creating: /tmp/directory02/
   extracting: /tmp/directory02/subdir02a
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b.
  checkdir error:  /tmp/directory01 exists but is not directory
                   unable to process directory01/file01.
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b/file02a.
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b/file02b.
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b/file02c.
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b/file02d.
  checkdir error:  /tmp/directory02/subdir02a exists but is not directory
                   unable to process directory02/subdir02a/subdir02b/file02e.

  -----------------------------------------------------------------------------------------------

  
  Version info:

  $ unzip --help

  UnZip 6.00 of 20 April 2009, by Debian.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unzip/+bug/1081362/+subscriptions




More information about the foundations-bugs mailing list