systemctl: gracefully adjust bus transport and runtime scope when --boot-loader-entry...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 4 Aug 2024 05:09:53 +0000 (14:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Aug 2024 20:33:25 +0000 (05:33 +0900)
commit1056457d1132e78cbf914e8abfa661465b952412
tree0fb29262baa16c8db3516c58d47544e4a07d828f
parentbcf982223cc5d051818dc88866a42f6a08f39a4a
systemctl: gracefully adjust bus transport and runtime scope when --boot-loader-entry=help

This fixes the following assertion:
===
SYSTEMD_LOG_LEVEL=debug systemctl --user -H foo --boot-loader-entry=help
Assertion 'transport != BUS_TRANSPORT_REMOTE || runtime_scope == RUNTIME_SCOPE_SYSTEM' failed at src/shared/bus-util.c:284, function bus_connect_transport(). Ignoring.
Failed to connect to bus: Operation not supported
===

Fixes a bug introduced by 97af80c5a7029c3f92e982dcf9338b9e67ad9cde.
Fixes #33661.
Fixes oss-fuzz#70153.
src/systemctl/systemctl-logind.c
test/fuzz/fuzz-systemctl-parse-argv/oss-fuzz-70153 [new file with mode: 0644]