Группа :: Архивирование/Резервное копирование
Пакет: tar
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: tar-1.15.1-cvs-20050113-name_size.patch
2005-01-13 Sergey Poznyakoff <gray@Mirddin.farlep.net>
* src/list.c (read_header): Fixed calculation of the
size for GNU long name/link. Tar was reading one block
more if name_size was divisible by 512. Thanks Josef
Bauer.
--- src/list.c 21 Dec 2004 14:44:03 -0000 1.80
+++ src/list.c 13 Jan 2005 15:59:26 -0000 1.81
@@ -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 ();