bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] bug in gtar 1.13.25 with deep directory structure


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] bug in gtar 1.13.25 with deep directory structure
Date: Thu, 13 Jan 2005 16:07:29 +0200

address@hidden wrote:

> In order to get my backup stable I imediately removed the
> index_files/index_files/... structure and now I cannot reproduce the
> error.

I see.
 
> Trying to reproduce the problem I think I produced some error possibly
> related to the problem:
[...]
> For what reason does msg.txt not show up any more? 

It *is* a bug. Thanks for discovering it. Attached is the patch.

> If I 'touch 12' in the very deep structure tar stops creating the
> archieve with an error 'File name too long'.

Filename and pathname lengths are limited by the filesystem.

Regards,
Sergey

Index: src/list.c
===================================================================
RCS file: /cvsroot/tar/tar/src/list.c,v
retrieving revision 1.80
diff -p -u -r1.80 list.c
--- src/list.c  21 Dec 2004 14:44:03 -0000      1.80
+++ src/list.c  13 Jan 2005 13:23:27 -0000
@@ -378,7 +378,11 @@ read_header (bool raw_extended_headers)
                   || header->header.typeflag == GNUTYPE_LONGLINK)
            {
              size_t name_size = current_stat_info.stat.st_size;
-             size = name_size - name_size % BLOCKSIZE + 2 * BLOCKSIZE;
+             size_t n = name_size % BLOCKSIZE;
+             size = name_size + BLOCKSIZE;
+             if (n)
+               size += BLOCKSIZE - n;
+
              if (name_size != current_stat_info.stat.st_size
                  || size < name_size)
                xalloc_die ();

reply via email to

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