duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] Error "Bad tarinfo name ././@LongLink"


From: Ben Escoto
Subject: Re: [Duplicity-talk] Error "Bad tarinfo name ././@LongLink"
Date: Thu, 13 Mar 2003 17:38:33 -0800

>>>>> "RB" == Rob Browning <address@hidden>
>>>>> wrote the following on Mon, 10 Mar 2003 12:06:25 -0600

  RB> OK.  Here's a very small test case -- shows tarfile.py returning
  RB> a file named "././@LongLink" for an (included) one-file tarfile.

Ok, thanks for the info.  I think I fixed it in CVS (see also attached
patch).  The problem was handling a long file which was symlinked to a
long file (either by itself was fine I think).

--- tarfile.py.old      2003-03-13 17:31:53.000000000 -0800
+++ tarfile.py  2003-03-13 17:27:13.000000000 -0800
@@ -1087,18 +1087,16 @@
         name = None
         linkname = None
         buf = self.fileobj.read(BLOCKSIZE)
-        if not buf:
-            return None
+        if not buf: return None
         self.offset += BLOCKSIZE
-        if type == GNUTYPE_LONGNAME:
-            name = nts(buf)
-        if type == GNUTYPE_LONGLINK:
-            linkname = nts(buf)
+        if type == GNUTYPE_LONGNAME: name = nts(buf)
+        if type == GNUTYPE_LONGLINK: linkname = nts(buf)
 
         buf = self.fileobj.read(BLOCKSIZE)
-        if not buf:
-            return None
+        if not buf: return None
         tarinfo = self._buftoinfo(buf)
+        if tarinfo.type in (GNUTYPE_LONGLINK, GNUTYPE_LONGNAME):
+            tarinfo = self._proc_gnulong(tarinfo, tarinfo.type)
         if name is not None:
             tarinfo.name = name
         if linkname is not None:


-- 
Ben Escoto

Attachment: pgp_kzlEs9J90.pgp
Description: PGP signature


reply via email to

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