From 0cfdf6da911550dd52bd8861159d9b44ae026a28 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 24 Oct 2023 19:37:24 +0200 Subject: [PATCH] zlib legacy decompress: return meta dict, fixes #7883 for the other compression methods, this is done in the base class, but the zlib legacy does not call that method as it also removes the header bytes, which zlib legacy does not have. --- src/borg/compress.pyx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/borg/compress.pyx b/src/borg/compress.pyx index e259c3748..3b6deb0d5 100644 --- a/src/borg/compress.pyx +++ b/src/borg/compress.pyx @@ -438,6 +438,12 @@ class ZLIB_legacy(CompressorBase): def decompress(self, meta, data): # note: for compatibility no super call, do not strip ID bytes + assert self.legacy_mode # only borg 1.x repos have the legacy ZLIB format + assert meta is None + meta = {} + meta["ctype"] = ZLIB.ID # change to non-legacy ZLIB id + meta["clevel"] = 255 # we do not know the compression level + meta["csize"] = len(data) try: return meta, zlib.decompress(data) except zlib.error as e: