bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] new/old extract problems with 6GB sparse file


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] new/old extract problems with 6GB sparse file
Date: Mon, 19 Jun 2006 10:22:37 +0300

> $ tar -xvjf jake.tar.bz2 --totals
> jake.ntfs
> Total bytes read: 3155937280 (3.0GiB, 3.2MiB/s)
> 
> This results in an extracted file of length 1997337088 bytes (~1.9GB),
> which looks very suspicious like a 4GB overflow!?

Yes, indeed. Can you please send me config.log file (created after you
run configure in GNU tar source directory).

> $ tar -xvjf jake.tar.bz2 -O --totals | cat >jake.ntfs
> jake.ntfs
> tar: jake.ntfs: Cannot seek to 61198336: Invalid argument

Please, try the attached patch. It disables seek autodetection on the
output file descriptor if -O is used.

Regards,
Sergey

Index: src/sparse.c
===================================================================
RCS file: /cvsroot/tar/tar/src/sparse.c,v
retrieving revision 1.21
diff -p -u -r1.21 sparse.c
--- src/sparse.c        10 Nov 2005 12:59:13 -0000      1.21
+++ src/sparse.c        19 Jun 2006 07:17:31 -0000
@@ -452,7 +452,7 @@ sparse_extract_file (int fd, struct tar_
 
   file.stat_info = st;
   file.fd = fd;
-  file.seekable = lseek (fd, 0, SEEK_SET) == 0;
+  file.seekable = to_stdout_option ? false : lseek (fd, 0, SEEK_SET) == 0;
   file.offset = 0;
 
   rc = tar_sparse_decode_header (&file);

reply via email to

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