[Bug 1357345] [NEW] tar: untaring with --recursive-unlink ends with an empty directory

Hibou57 (Yannick Duchêne) yannick_duchene at yahoo.fr
Fri Aug 15 12:10:54 UTC 2014


Public bug reported:

Using tar version 1.26-4ubuntu1 from Ubuntu 12.04 (I'm submitting this
case here, as I can't tell if it's specific to the tar shipped with
Ubuntu or a bug with all tar, and this concerns Ubuntu base packages
anyway).

Using the attached archive file, running this:

/bin/tar --extract --auto-compress --exclude-backups --exclude-caches
--exclude-vcs --preserve-permissions --recursive-unlink --totals
--unlink-first --verbose --file Sphinx.tar.xz; ls Sphinx

… I get an empty directory, although the output says it extracted many
things.

This seems to be related to a buggy `--recursive-unlink` option, as this
one works:

/bin/tar --extract --auto-compress --exclude-backups --exclude-caches
--exclude-vcs --preserve-permissions --totals --unlink-first --verbose
--file Sphinx.tar.xz; ls Sphinx

… the directory is not empty any‑more.

I get this unexpected behaviour with this archive only, not with others.

My guess is that it's due to the order in which the entries appears in
the tar file. Indeed, the Sphinx top level directory is listed last, and
its content before it, so tar extract its content then delete all the
directory to recreate the directory, emptied.

I can't believe this is the expected behaviour.

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

** Attachment added: "The archive exposing the bug"
   https://bugs.launchpad.net/bugs/1357345/+attachment/4178372/+files/Sphinx.tar.xz

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

Title:
  tar: untaring with --recursive-unlink ends with an empty directory

Status in “tar” package in Ubuntu:
  New

Bug description:
  Using tar version 1.26-4ubuntu1 from Ubuntu 12.04 (I'm submitting this
  case here, as I can't tell if it's specific to the tar shipped with
  Ubuntu or a bug with all tar, and this concerns Ubuntu base packages
  anyway).

  Using the attached archive file, running this:

  /bin/tar --extract --auto-compress --exclude-backups --exclude-caches
  --exclude-vcs --preserve-permissions --recursive-unlink --totals
  --unlink-first --verbose --file Sphinx.tar.xz; ls Sphinx

  … I get an empty directory, although the output says it extracted many
  things.

  This seems to be related to a buggy `--recursive-unlink` option, as
  this one works:

  /bin/tar --extract --auto-compress --exclude-backups --exclude-caches
  --exclude-vcs --preserve-permissions --totals --unlink-first --verbose
  --file Sphinx.tar.xz; ls Sphinx

  … the directory is not empty any‑more.

  I get this unexpected behaviour with this archive only, not with
  others.

  My guess is that it's due to the order in which the entries appears in
  the tar file. Indeed, the Sphinx top level directory is listed last,
  and its content before it, so tar extract its content then delete all
  the directory to recreate the directory, emptied.

  I can't believe this is the expected behaviour.

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



More information about the foundations-bugs mailing list