[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Extract error after failed open()
From: |
Jan-Benedict Glaw |
Subject: |
Re: [Bug-tar] Extract error after failed open() |
Date: |
Mon, 4 Dec 2006 17:46:19 +0100 |
User-agent: |
Mutt/1.5.9i |
On Thu, 2006-11-30 19:41:06 +0100, Jan-Benedict Glaw <address@hidden> wrote:
> On Thu, 2006-11-30 11:51:29 +0200, Sergey Poznyakoff <address@hidden> wrote:
> > > GNU tar signals the open() error and prints a message like "skipping
> > > to next header", but with my (real 16 GB) copy, "skipping to next
> > > header" looked like "skipping to end of archive." Finally, only half
> > > of the data was copied.
> > >
> > > Easy solution: Call skip_member() in the error path as it is done in
> > > a different case.
> >
> > This will certainly fix this particular case, but the cause of the
> > misbehavior will remain unknown. I have tried to reprouce the bug using
> > several crafted archives but was unable to do so. Could you supply some
> > more info on how to reproduce it?
>
> The key point is that the open call needs to fail. Have you been able
> to reproduce at least that (strace should easily show that.)
At least it's easy to reproduce it here:
bixie:/home/jbglaw/tar-test# ls -l test/ mnt/
mnt/:
total 0
test/:
total 4
-rw-r--r-- 1 root root 1 2006-12-04 17:39 invalid [ ? ] file.txt
-rw-r--r-- 1 root root 0 2006-12-04 17:34 normalfile.txt
bixie:/home/jbglaw/tar-test# mount | grep vfat
/home/jbglaw/tar-test/vfat-image on /home/jbglaw/tar-test/mnt type vfat
(rw,loop=/dev/loop0)
(The key point is that with this file name, the "invalid" file on my
ext3 filesystem is one byte long.)
bixie:/home/jbglaw/tar-test# ( cd test/ && tar cf - . ) | ( cd mnt && tar xf -;)
tar: ./invalid [ ? ] file.txt: Cannot open: Invalid argument
tar: Error exit delayed from previous errors
bixie:/home/jbglaw/tar-test# ls -l mnt/
total 0
bixie:/home/jbglaw/tar-test# tar --version
tar (GNU tar) 1.16
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
I've also attached the generated tarball. With my proposed patch, the
second file ("normalfile.txt") would have been extracted. I hope this
is enough to accept the patch...
MfG, JBG
--
Jan-Benedict Glaw address@hidden +49-172-7608481
Signature of: Fortschritt bedeutet, einen Schritt so zu machen,
the second : daß man den nächsten auch noch machen kann.
test.tar
Description: Unix tar archive
signature.asc
Description: Digital signature
- Re: [Bug-tar] Extract error after failed open(),
Jan-Benedict Glaw <=