代码拉取完成,页面将自动刷新
From 71efbe69b6b7a0d6a663b8dbe6fe4d8f5655848a Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@gmail.com>
Date: Mon, 6 Jan 2025 18:16:29 +0000
Subject: [PATCH] core: fix assert when AddDependencyUnitFiles is called with
invalid parameter
unit_file_add_dependency() asserts, so check before calling it that the
type is expected, or return EINVAL to the caller.
root@localhost:~# busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager AddDependencyUnitFiles "asssbb" 0 uwhatm8 After 1 1
Broadcast message from systemd-journald@localhost (Mon 2025-01-06 18:12:14 UTC):
systemd[1]: Caught <ABRT>, from our own process.
Fixes https://github.com/systemd/systemd/issues/35882
(cherry picked from commit d87dc74e8f1a30d72a0f202e411400bab34ab55a)
(cherry picked from commit b6792202f31c4e83d23a944b845e1f17fc14f619)
(cherry picked from commit c65056e1318fe20cf9b62771ffa589abe2c21a76)
(cherry picked from commit 4d47117b05f2bd836c465c3efdee69c5a573e8d6)
Conflict:context adaptation
Reference:https://github.com/systemd/systemd-stable/commit/71efbe69b6b7a0d6a663b8dbe6fe4d8f5655848a
---
src/core/dbus-manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 856dd3b5dc..dea69bb6e2 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -2820,7 +2820,7 @@ static int method_add_dependency_unit_files(sd_bus_message *message, void *userd
flags = unit_file_bools_to_flags(runtime, force);
dep = unit_dependency_from_string(type);
- if (dep < 0)
+ if (dep < 0 || !IN_SET(dep, UNIT_WANTS, UNIT_REQUIRES))
return -EINVAL;
r = unit_file_add_dependency(m->runtime_scope, flags, NULL, l, target, dep, &changes, &n_changes);
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。