From: Milo Turner Date: Fri, 13 Aug 2021 14:28:58 +0000 (-0400) Subject: Don't open /var journals in volatile mode when runtime_journal==NULL X-Git-Tag: v250-rc1~830 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d64441b669932ab97fbbfc71cb143045f690039e;p=thirdparty%2Fsystemd.git Don't open /var journals in volatile mode when runtime_journal==NULL --- diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index d410d7cf19c..f2189964f0f 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -408,6 +408,13 @@ static JournalFile* find_journal(Server *s, uid_t uid) { if (s->runtime_journal) return s->runtime_journal; + /* If we are not in persistent mode, then we need return NULL immediately rather than opening a + * persistent journal of any sort. + * + * Fixes https://github.com/systemd/systemd/issues/20390 */ + if (!IN_SET(s->storage, STORAGE_AUTO, STORAGE_PERSISTENT)) + return NULL; + if (uid_for_system_journal(uid)) return s->system_journal;