summaryrefslogtreecommitdiffstats
path: root/src/systemctl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:25:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:25:59 +0000
commit1e34d75027c0773e21b35688c27034d5af5e635c (patch)
tree7f3e33142d7a4d06037846454f08b1b0350b2a95 /src/systemctl
parentAdding upstream version 256.4. (diff)
downloadsystemd-1e34d75027c0773e21b35688c27034d5af5e635c.tar.xz
systemd-1e34d75027c0773e21b35688c27034d5af5e635c.zip
Adding upstream version 256.5.upstream/256.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl-logind.c8
-rw-r--r--src/systemctl/systemctl.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/systemctl/systemctl-logind.c b/src/systemctl/systemctl-logind.c
index d6cdd97..4507000 100644
--- a/src/systemctl/systemctl-logind.c
+++ b/src/systemctl/systemctl-logind.c
@@ -432,6 +432,14 @@ int help_boot_loader_entry(void) {
sd_bus *bus;
int r;
+ /* This is called without checking runtime scope and bus transport like we do in parse_argv().
+ * Loading boot entries is only supported by system scope. Let's gracefully adjust them. */
+ arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
+ if (arg_transport == BUS_TRANSPORT_CAPSULE) {
+ arg_host = NULL;
+ arg_transport = BUS_TRANSPORT_LOCAL;
+ }
+
r = acquire_bus(BUS_FULL, &bus);
if (r < 0)
return r;
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0ca76ac..97bdfad 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1073,6 +1073,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Cannot access user instance remotely.");
+ if (arg_transport == BUS_TRANSPORT_CAPSULE && arg_runtime_scope != RUNTIME_SCOPE_USER)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Cannot access system instance with --capsule=/-C.");
+
if (arg_wait && arg_no_block)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--wait may not be combined with --no-block.");