bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Archive isn't fully extracted after error on open()


From: Jan-Benedict Glaw
Subject: [Bug-tar] Archive isn't fully extracted after error on open()
Date: Wed, 29 Nov 2006 23:17:44 +0100
User-agent: Mutt/1.5.9i

Hi!

Debian's tar-1.16 version does have a bug which I triggered like this
on a GNU/Linux PC:

  * mkdir testdir
  * touch 'testdir/strange [ ] ? file'
  * mount -t vfat /dev/usb-stick /mnt/usb-stick
  * tar cpf - testdir | ( cd /mnt/usb-stick && tar xpf -;)

Linux' vfat filesystem driver refuses to create files containing '?',
'[' or ']' and returns -EINVAL.

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.

Thanks,
        Jan-Benedict Glaw

--- tar-1.16/src/extract.c~     2006-11-28 23:21:47.000000000 +0100
+++ tar-1.16/src/extract.c      2006-11-28 23:22:07.000000000 +0100
@@ -751,6 +751,7 @@
       if (fd < 0)
        {
          open_error (file_name);
+         skip_member ();
          return 1;
        }
     }
-- 
      Jan-Benedict Glaw      address@hidden              +49-172-7608481
 Signature of:                    Don't believe in miracles: Rely on them!
 the second  :

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]