Don't open /var journals in volatile mode when runtime_journal==NULL

This commit is contained in:
Milo Turner
2021-08-13 10:28:58 -04:00
committed by Lennart Poettering
parent 8908ceb7a8
commit d64441b669

View File

@@ -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;