[Top][All Lists]

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

Re: [Bug-tar] 'BZh[1-9]' file in v7 format archive confuses GNU tar

From: Joerg Schilling
Subject: Re: [Bug-tar] 'BZh[1-9]' file in v7 format archive confuses GNU tar
Date: Tue, 27 Nov 2018 11:56:11 +0100
User-agent: Heirloom mailx 12.5 7/5/10

Micha? Górny <address@hidden> wrote:

> Here's another quirk I've found:
> $ echo test > BZh5
> $ tar --format=v7 -cf test.tar BZh5
> $ tar -xf test.tar
> bzip2: stdin: compressed data error: bad block header magic
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
> I think the easiest solution would be to copy the trick used
> by libarchive, citing:
>   /* After BZh[1-9], there must be either a data block
>    * which begins with 0x314159265359 or an end-of-data
>    * marker of 0x177245385090. */
> However, this wouldn't help with the harder (though less likely to occur
> accidentally) case of:
> $ echo test > 'BZh91AY&SY'

An interesting discovery!

I however believe that the format recognition in "star" would not be fooled by 
this and since star first checks for archive formats before it checks for 
compression, this should not be a problem.

BTW: I could not trigger this problem with older gtar versions, when did gtar 
introduce automated compression detection?


 EMail:address@hidden                    (home) Jörg Schilling D-13353 Berlin
    address@hidden (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

reply via email to

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