I have noticed a problem restoring files where there filename plus the null terminator = 512 characters. The problem appears to be in the calculation of the number of blocks required to store the LongLink information.
The source code I have is for tar 1.15.1. I believe the problem is in the list.c - read_header function.
The code from line 377
else if (header->header.typeflag == GNUTYPE_LONGNAME
|| header->header.typeflag == GNUTYPE_LONGLINK)
{
size_t name_size = current_stat_info.stat.st_size;
size = name_size - name_size % BLOCKSIZE + 2 * BLOCKSIZE;
if (name_size != current_stat_info.stat.st_size
|| size < name_size)
xalloc_die ();
For files with a filename length of exactly 512 characters, and multiples of, the size is calculated as 1536 causing the read to require an extra null block after the name data. This I believe is incorrect and should only be 1024 as calculated in the write_gnu_long_link function in create.c
Regards,
Steve.
--------------------------------------------------------------- Vogon International Limited http://www.vogon-international.com |
_______________________________________________ Bug-tar mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-tar
