ryantimwilson / rpms / systemd

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