803fb7
From 8cfa250db93688a0796475cb911215e4edb252aa Mon Sep 17 00:00:00 2001
803fb7
From: Lennart Poettering <lennart@poettering.net>
803fb7
Date: Fri, 24 Jul 2015 02:02:07 +0200
803fb7
Subject: [PATCH] journal: explain the error when we find a non-DATA object
803fb7
 that is compressed
803fb7
803fb7
Only objects of type DATA may be compressed, generate a message about
803fb7
that, like we do for all other errros.
803fb7
803fb7
Cherry-picked from: bca9e39dfadaefc4b02c0dd378adc3d6221071de
803fb7
Related: #1350232
803fb7
---
803fb7
 src/journal/journal-verify.c | 4 +++-
803fb7
 1 file changed, 3 insertions(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
803fb7
index 53f0550da..77fb4090d 100644
803fb7
--- a/src/journal/journal-verify.c
803fb7
+++ b/src/journal/journal-verify.c
803fb7
@@ -123,8 +123,10 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o
803fb7
          * other objects. */
803fb7
 
803fb7
         if ((o->object.flags & OBJECT_COMPRESSED_XZ) &&
803fb7
-            o->object.type != OBJECT_DATA)
803fb7
+            o->object.type != OBJECT_DATA) {
803fb7
+                error(offset, "Found compressed object that isn't of type DATA, which is not allowed.");
803fb7
                 return -EBADMSG;
803fb7
+        }
803fb7
 
803fb7
         switch (o->object.type) {
803fb7