加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-sysext-refuse-empty-release-ID-to-avoid-triggering-a.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
hongjinghao 提交于 2023-06-19 10:57 . sync patches from systemd community
From 6100e1dded709f681aca0cf913095e2591a54e33 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sat, 21 May 2022 03:03:21 +0900
Subject: [PATCH] sysext: refuse empty release ID to avoid triggering assertion
Otherwise, the assertion in extension_release_validate() will be
triggered.
(cherry picked from commit 30e29edf4c0bb025aa7dc03c415b727fddf996ac)
---
src/sysext/sysext.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c
index 60789e0f2c..4245bf1760 100644
--- a/src/sysext/sysext.c
+++ b/src/sysext/sysext.c
@@ -483,6 +483,10 @@ static int merge_subprocess(Hashmap *images, const char *workspace) {
"SYSEXT_LEVEL", &host_os_release_sysext_level);
if (r < 0)
return log_error_errno(r, "Failed to acquire 'os-release' data of OS tree '%s': %m", empty_to_root(arg_root));
+ if (isempty(host_os_release_id))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "'ID' field not found or empty in 'os-release' data of OS tree '%s': %m",
+ empty_to_root(arg_root));
/* Let's now mount all images */
HASHMAP_FOREACH(img, images) {
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化