]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: do not rotate unrelated journal files when full or corrupted
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 22 Apr 2024 08:25:31 +0000 (17:25 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 23 Apr 2024 13:13:05 +0000 (15:13 +0200)
commitbd0ec61ae3bb7a5200b344bab46ba2d6b9406aac
tree3d97b3b7cc2ac568e1327b67b2ba65035783c646
parent00bc83a275fa3ca8d90579fe9597d8b651d47332
journal: do not rotate unrelated journal files when full or corrupted

When we fail to add an entry to a journal file, typically when the file
is full or corrupted, it is not necessary to rotate other journal files.

Not only that's unnecessary, rotating all journal files allows
unprivileged users to wipe system or other user's journals by writing
many journal entries to their own user journal file.

Let's rotate all journal files only when
- it is really requested by a privileged user (e.g. by journalctl --rotate), or
- the system time jumps backwards.
And, otherwise rotate only the journal file we are currently writing.
src/journal/journald-server.c