]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Don't open /var journals in volatile mode when runtime_journal==NULL
authorMilo Turner <mturner@starry.com>
Fri, 13 Aug 2021 14:28:58 +0000 (10:28 -0400)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Aug 2021 19:43:59 +0000 (21:43 +0200)
src/journal/journald-server.c

index d410d7cf19ce5ddf9412f30fae073f124f8e5617..f2189964f0fafaee538b7c73cc8c985df430f783 100644 (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;