1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00

sd-journal: fix check in journal_file_verify_header()

Fixes 6ea51363c8e39fb0924dda972a212936456a2b4f
This commit is contained in:
Antonio Alvarez Feijoo 2024-04-05 08:27:36 +02:00 committed by Daan De Meyer
parent aaa872a713
commit 1eeae735ad

View File

@ -638,7 +638,7 @@ static int journal_file_verify_header(JournalFile *f) {
return -ENODATA;
if (!VALID_REALTIME(le64toh(f->header->tail_entry_realtime)))
return -ENODATA;
if (!VALID_MONOTONIC(le64toh(f->header->tail_entry_realtime)))
if (!VALID_MONOTONIC(le64toh(f->header->tail_entry_monotonic)))
return -ENODATA;
} else {
/* Otherwise, the fields must be zero. */
@ -649,7 +649,7 @@ static int journal_file_verify_header(JournalFile *f) {
return -ENODATA;
if (f->header->tail_entry_realtime != 0)
return -ENODATA;
if (f->header->tail_entry_realtime != 0)
if (f->header->tail_entry_monotonic != 0)
return -ENODATA;
}
}
@ -2531,7 +2531,7 @@ int journal_file_append_entry(
ts->realtime);
if (!VALID_MONOTONIC(ts->monotonic))
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
"Invalid monotomic timestamp %" PRIu64 ", refusing entry.",
"Invalid monotonic timestamp %" PRIu64 ", refusing entry.",
ts->monotonic);
} else {
dual_timestamp_now(&_ts);