代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From fb999b918462361fefa435f86884f81edff503c5 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 30 Aug 2021 13:21:55 +0200
Subject: [PATCH] run/mount/systemctl: don't fork off PolicyKit/ask-pw agent
when in --user mode
When we are in --user mode there's no point in doing PolicyKit/ask-pw
because both of these systems are only used by system-level services.
Let's disable the two agents for that automaticlly hence.
Prompted by: #20576
(cherry picked from commit 966f3a246c8c804d8a9c9d393f03c5c3fe0dd393)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/fb999b918462361fefa435f86884f81edff503c5
---
src/mount/mount-tool.c | 3 +++
src/run/run.c | 4 ++++
src/systemctl/systemctl.c | 5 +++++
3 files changed, 12 insertions(+)
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c
index c213c905a1..70b4c5a765 100644
--- a/src/mount/mount-tool.c
+++ b/src/mount/mount-tool.c
@@ -332,6 +332,9 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option");
}
+ if (arg_user)
+ arg_ask_password = false;
+
if (arg_user && arg_transport != BUS_TRANSPORT_LOCAL)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Execution in user context is not supported on non-local systems.");
diff --git a/src/run/run.c b/src/run/run.c
index 38de0322e0..1c83e36e4e 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -506,6 +506,10 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option");
}
+ /* If we are talking to the per-user instance PolicyKit isn't going to help */
+ if (arg_user)
+ arg_ask_password = false;
+
with_trigger = !!arg_path_property || !!arg_socket_property || arg_with_timer;
/* currently, only single trigger (path, socket, timer) unit can be created simultaneously */
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 4cc723aab5..2f6f58127c 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -925,6 +925,11 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option");
}
+ /* If we are in --user mode, there's no point in talking to PolicyKit or the infra to query system
+ * passwords */
+ if (arg_scope != UNIT_FILE_SYSTEM)
+ arg_ask_password = false;
+
if (arg_transport == BUS_TRANSPORT_REMOTE && arg_scope != UNIT_FILE_SYSTEM)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Cannot access user instance remotely.");
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。