Debian Bug report logs - #576876
tar: infinite loop in case of existing symlink

version graph

Package: tar; Maintainer for tar is Bdale Garbee <bdale@gag.com>; Source for tar is src:tar (PTS, buildd, popcon).

Reported by: Thomas Schwinge <thomas@schwinge.name>

Date: Wed, 7 Apr 2010 22:42:01 UTC

Severity: important

Tags: patch

Merged with 577978

Found in version tar/1.23-1

Fixed in version tar/1.23-2.1

Done: Michael Banck <mbanck@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#576876; Package tar. (Wed, 07 Apr 2010 22:42:04 GMT) (full text, mbox, link).


Acknowledgement sent to Thomas Schwinge <thomas@schwinge.name>:
New Bug report received and forwarded. Copy sent to Bdale Garbee <bdale@gag.com>. (Wed, 07 Apr 2010 22:42:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Thomas Schwinge <thomas@schwinge.name>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: tar: no progress made in case of existing symlink
Date: Thu, 08 Apr 2010 00:31:37 +0200
Package: tar
Version: 1.23-1
Severity: important

Hello!

I found a problem in this version of tar.

    thomas@boole:/tmp/d $ ar x ../tmp.cgJjcD65ng/target/var/cache/apt/archives/bash_4.1-2_hurd-i386.deb
    thomas@boole:/tmp/d $ gunzip < data.tar.gz | tar -xkf -
    thomas@boole:/tmp/d $ ls -l bin/sh
    lrwxrwxrwx 1 thomas thomas 4  8. Apr 00:23 bin/sh -> bash
    thomas@boole:/tmp/d $ ar x ../tmp.cgJjcD65ng/target/var/cache/apt/archives/dash_0.5.5.1-3_hurd-i386.deb
    thomas@boole:/tmp/d $ gunzip < data.tar.gz | tar -xkf -

At this point no further progress is being made, and strace tells me:

    symlink("dash", "./bin/sh")             = -1 EEXIST (File exists)
    symlink("dash", "./bin/sh")             = -1 EEXIST (File exists)
    symlink("dash", "./bin/sh")             = -1 EEXIST (File exists)
    symlink("dash", "./bin/sh")             = -1 EEXIST (File exists)
    symlink("dash", "./bin/sh")             = -1 EEXIST (File exists)
    [...]

dash tries to replace the /bin/sh symlink (which tar -k should prevent),
but there's obviously something wrong.

This should not be specific to using hurd-i386 debs, but I didn't check.
(I found this problem while doing an installation of Debian GNU/Hurd
using Debian's crosshurd package.)


After installing tar_1.20-1_amd64.deb (Debian stable):

    thomas@boole:/tmp/d $ rm -rf ./*
    thomas@boole:/tmp/d $ ar x ../tmp.cgJjcD65ng/target/var/cache/apt/archives/bash_4.1-2_hurd-i386.deb
    thomas@boole:/tmp/d $ gunzip < data.tar.gz | tar -xkf -
    thomas@boole:/tmp/d $ ar x ../tmp.cgJjcD65ng/target/var/cache/apt/archives/dash_0.5.5.1-3_hurd-i386.deb
    thomas@boole:/tmp/d $ gunzip < data.tar.gz | tar -xkf -
    tar: ./bin/sh: Cannot create symlink to `dash': File exists
    tar: ./usr/share/man/man1/sh.1.gz: Cannot create symlink to `dash.1.gz': File exists
    tar: Error exit delayed from previous errors
    thomas@boole:/tmp/d $ echo $?
    2

tar doesn't hang.  (I'm not sure that this error message is appropriate
with tar -k, but that's a different issue.)


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-4-xen-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tar depends on:
ii  libc6                         2.10.2-6   Embedded GNU C Library: Shared lib

tar recommends no packages.

Versions of packages tar suggests:
ii  bzip2             1.0.5-4                high-quality block-sorting file co
ii  lzma              4.43-14                Compression method of 7z format in
pn  ncompress         <none>                 (no description available)
ii  xz-utils          4.999.9beta+20100307-1 XZ-format compression utilities

-- no debconf information


Regards,
 Thomas




Information forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#576876; Package tar. (Fri, 16 Apr 2010 22:39:02 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to Bdale Garbee <bdale@gag.com>. (Fri, 16 Apr 2010 22:39:03 GMT) (full text, mbox, link).


Message #10 received at 576876@bugs.debian.org (full text, mbox, reply):

From: Michael Banck <mbanck@debian.org>
To: 576876@bugs.debian.org
Subject: Re: tar: no progress made in case of existing symlink
Date: Sat, 17 Apr 2010 00:36:23 +0200
retitle 576876 tar: infinite loop in case of existing symlink
thanks

Hi,

as a data point, 1.22-2 is still alright, 1.23-1 is the problem.


Michael




Changed Bug title to 'tar: infinite loop in case of existing symlink' from 'tar: no progress made in case of existing symlink' Request was from Michael Banck <mbanck@debian.org> to control@bugs.debian.org. (Fri, 16 Apr 2010 22:39:08 GMT) (full text, mbox, link).


Merged 576876 577978. Request was from Michael Banck <mbanck@debian.org> to control@bugs.debian.org. (Fri, 16 Apr 2010 22:39:12 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#576876; Package tar. (Wed, 09 Jun 2010 06:54:07 GMT) (full text, mbox, link).


Acknowledgement sent to Hans Streibel <hans@streibel.net>:
Extra info received and forwarded to list. Copy sent to Bdale Garbee <bdale@gag.com>. (Wed, 09 Jun 2010 06:54:07 GMT) (full text, mbox, link).


Message #19 received at 576876@bugs.debian.org (full text, mbox, reply):

From: Hans Streibel <hans@streibel.net>
To: 576876@bugs.debian.org
Subject: Re: tar: no progress made in case of existing symlink
Date: Wed, 9 Jun 2010 08:34:24 +0200
I was told that this bug has already been fixed in GNU tar:
commit b60e56fd

http://www.ohloh.net/p/tar/commits/70461246

Now it has to make its way into the Debian packages,
hopefully ASAP.

Hans




Information forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#576876; Package tar. (Tue, 13 Jul 2010 18:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to Bdale Garbee <bdale@gag.com>. (Tue, 13 Jul 2010 18:03:03 GMT) (full text, mbox, link).


Message #24 received at 576876@bugs.debian.org (full text, mbox, reply):

From: Michael Banck <mbanck@debian.org>
To: 576876@bugs.debian.org
Subject: Re: tar: no progress made in case of existing symlink
Date: Tue, 13 Jul 2010 20:00:02 +0200
[Message part 1 (text/plain, inline)]
tags 576876 +patch
thanks

On Sat, Apr 17, 2010 at 12:36:23AM +0200, Michael Banck wrote:
> as a data point, 1.22-2 is still alright, 1.23-1 is the problem.

This is a trivial recipe to reproduce it:

$ ln -s foo bar
$ tar cf bar.tar bar 
$ cat bar.tar | tar -xkf - 
<hang>

I have attached an interdiff which fixes this, I might NMU this during
the BSP this weekend. 


Michael
[interdiff (text/plain, attachment)]

Added tag(s) patch. Request was from Michael Banck <mbanck@debian.org> to control@bugs.debian.org. (Tue, 13 Jul 2010 18:03:06 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#576876; Package tar. (Sun, 18 Jul 2010 15:36:05 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to Bdale Garbee <bdale@gag.com>. (Sun, 18 Jul 2010 15:36:05 GMT) (full text, mbox, link).


Message #31 received at 576876@bugs.debian.org (full text, mbox, reply):

From: Michael Banck <mbanck@debian.org>
To: 576876@bugs.debian.org
Subject: Re: tar: no progress made in case of existing symlink
Date: Sun, 18 Jul 2010 17:34:15 +0200
[Message part 1 (text/plain, inline)]
tags 576876 +pending
thanks

On Tue, Jul 13, 2010 at 08:00:02PM +0200, Michael Banck wrote:
> I have attached an interdiff which fixes this, I might NMU this during
> the BSP this weekend. 

I have now uploaded the attached interdiff to DELAYED/2-day.


Cheers,

Michael
[tar.interdiff (text/plain, attachment)]

Added tag(s) pending. Request was from Michael Banck <mbanck@debian.org> to control@bugs.debian.org. (Sun, 18 Jul 2010 15:36:06 GMT) (full text, mbox, link).


Reply sent to Michael Banck <mbanck@debian.org>:
You have taken responsibility. (Tue, 20 Jul 2010 16:06:04 GMT) (full text, mbox, link).


Notification sent to Thomas Schwinge <thomas@schwinge.name>:
Bug acknowledged by developer. (Tue, 20 Jul 2010 16:06:04 GMT) (full text, mbox, link).


Message #38 received at 576876-close@bugs.debian.org (full text, mbox, reply):

From: Michael Banck <mbanck@debian.org>
To: 576876-close@bugs.debian.org
Subject: Bug#576876: fixed in tar 1.23-2.1
Date: Tue, 20 Jul 2010 16:04:22 +0000
Source: tar
Source-Version: 1.23-2.1

We believe that the bug you reported is fixed in the latest version of
tar, which is due to be installed in the Debian FTP archive:

tar_1.23-2.1.diff.gz
  to main/t/tar/tar_1.23-2.1.diff.gz
tar_1.23-2.1.dsc
  to main/t/tar/tar_1.23-2.1.dsc
tar_1.23-2.1_i386.deb
  to main/t/tar/tar_1.23-2.1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 576876@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Banck <mbanck@debian.org> (supplier of updated tar package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Sun, 18 Jul 2010 17:14:48 +0200
Source: tar
Binary: tar
Architecture: source i386
Version: 1.23-2.1
Distribution: unstable
Urgency: low
Maintainer: Bdale Garbee <bdale@gag.com>
Changed-By: Michael Banck <mbanck@debian.org>
Description: 
 tar        - GNU version of the tar archiving utility
Closes: 576876 577978
Changes: 
 tar (1.23-2.1) unstable; urgency=low
 .
   * Non-maintainer upload.
   * src/extract.c: Apply upstream git commit b60e56fd which fixes a dead loop
     on extracting existing symlinks with the -k option, closes: #577978,
     #576876.
Checksums-Sha1: 
 f1c94820a92f7ed443456397a23bd8610f170e13 985 tar_1.23-2.1.dsc
 26e0ec8d6af5f08503dc276e99ee5616444a3597 18493 tar_1.23-2.1.diff.gz
 a0b3e58316381b395750db959ad6c6ec41f89f56 911966 tar_1.23-2.1_i386.deb
Checksums-Sha256: 
 d28fc08fd44cb2edf337962aeb7e2bb362fb6cc3bf959a20cc03727f41b7ddb3 985 tar_1.23-2.1.dsc
 4ff2fbeef3541ddcd242525cc917b9fbdb6008fb794a24429795371f683e0157 18493 tar_1.23-2.1.diff.gz
 2480a9e3bedc1d81124451758f274352c0ce2db5f7abd4a57e46b46b9c54a602 911966 tar_1.23-2.1_i386.deb
Files: 
 687990b02cad5fe94a1c20bef91aa1c9 985 utils required tar_1.23-2.1.dsc
 5c55b2c4eeabae92cd6d47ceb4973ebd 18493 utils required tar_1.23-2.1.diff.gz
 f5cf51556ec003b0392e38efd39adf81 911966 utils required tar_1.23-2.1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFMQx3QmHaJYZ7RAb8RAziHAJ4x7P6q0lxMckZ3C1ULtHW0nZf2VwCfVHkl
AJaYhGF/QMikfugQA2MnXtA=
=FX8k
-----END PGP SIGNATURE-----





Reply sent to Michael Banck <mbanck@debian.org>:
You have taken responsibility. (Tue, 20 Jul 2010 16:06:05 GMT) (full text, mbox, link).


Notification sent to Jakub Wilk <jwilk@debian.org>:
Bug acknowledged by developer. (Tue, 20 Jul 2010 16:06:05 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 28 Aug 2010 07:36:05 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jan 7 03:23:31 2018; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.