1 Star 0 Fork 98

Mingtai/systemd_1

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Don-t-open-var-journals-in-volatile-mode-when-runtim.patch 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
From 00e7f0994a39852ab1adabfb7e19ff2634e916a0 Mon Sep 17 00:00:00 2001
From: Milo Turner <mturner@starry.com>
Date: Fri, 13 Aug 2021 10:28:58 -0400
Subject: [PATCH] Don't open /var journals in volatile mode when
runtime_journal==NULL
(cherry picked from commit d64441b669932ab97fbbfc71cb143045f690039e)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/00e7f0994a39852ab1adabfb7e19ff2634e916a0
---
src/journal/journald-server.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 30f04f5383..a0695ec519 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -415,6 +415,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;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd_1.git
git@gitee.com:yangmingtaip/systemd_1.git
yangmingtaip
systemd_1
systemd_1
master

搜索帮助