[Top][All Lists]

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

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

From: Michał Górny
Subject: [Bug-tar] 'BZh[1-9]' file in v7 format archive confuses GNU tar
Date: Mon, 26 Nov 2018 18:44:14 +0100


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'


Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

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