ryantimwilson / rpms / systemd

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