support LZMA concatenated files
authorMatthew Thode <mthode@mthode.org>
Thu, 11 Jan 2018 16:48:43 +0000 (10:48 -0600)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jan 2018 22:38:04 +0000 (23:38 +0100)
The xz format supports concatenated files, images are sometimes created
and shipped with it to increase compression.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1742744 is
the source bug for this issue.

src/import/import-compress.c

index cb5b982..acb47fe 100644 (file)
@@ -70,7 +70,7 @@ int import_uncompress_detect(ImportCompress *c, const void *data, size_t size) {
         if (memcmp(data, xz_signature, sizeof(xz_signature)) == 0) {
                 lzma_ret xzr;
 
-                xzr = lzma_stream_decoder(&c->xz, UINT64_MAX, LZMA_TELL_UNSUPPORTED_CHECK);
+                xzr = lzma_stream_decoder(&c->xz, UINT64_MAX, LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED);
                 if (xzr != LZMA_OK)
                         return -EIO;