GNU bug report logs - #3410
tar mode fails to open many valid files

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <p.pogonyshev <at> anakreon.net>

Date: Thu, 28 May 2009 14:15:04 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #55 received at 3410-close <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Paul Pogonyshev <p.pogonyshev <at> anakreon.net>
Cc: 3410-close <at> debbugs.gnu.org
Subject: Re: bug#3410: tar mode fails to open many valid files
Date: Thu, 04 Jun 2009 16:48:56 -0400
> I.e. it works fine with
>    emacs -Q ~/tmp/poi-bin-3.5-beta5-20090219.tar.gz
> but shows your problem with
>    emacs -Q -f url-handler-mode; C-x C-f http://.../poi... RET

In the end you were right, and I have no idea how I managed to get the
above results.  url-handler-mode makes no difference, and the 64bit
thingy makes a difference (it somehow hides the bug, so it doesn't
signal an error but instead misinterprets the middle of the tar file,
while the beginning and the end are still just fine, so my cursory check
didn't see the corruption).

I've just installed the patch below, which should fix the problem,


        Stefan


--- tar-mode.el.~1.139.~	2009-03-20 16:24:31.000000000 -0400
+++ tar-mode.el	2009-06-04 16:41:49.000000000 -0400
@@ -276,7 +276,10 @@
             (setq link-p 5))            ; directory
 
         (if (and (equal name "././@LongLink")
-                 (equal magic-str "ustar ")) ;OLDGNU_MAGIC.
+                 ;; Supposedly @LongLink is only used for GNUTAR
+                 ;; format (i.e. "ustar ") but some POSIX Tar files
+                 ;; (with "ustar\0") have been seen using it as well.
+                 (member magic-str '("ustar " "ustar\0")))
             ;; This is a GNU Tar long-file-name header.
             (let* ((size (tar-parse-octal-integer
                           string tar-size-offset tar-time-offset))



This bug report was last modified 15 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.