mirror of
https://github.com/systemd/systemd.git
synced 2025-01-24 06:04:05 +03:00
Merge pull request #33933 from yuwata/systemctl-bus-transport-and-runtime-scope
systemctl: fix bus transport and runtime scope handling
This commit is contained in:
commit
5a5a7093b8
@ -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;
|
||||
|
@ -1075,6 +1075,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.");
|
||||
|
BIN
test/fuzz/fuzz-systemctl-parse-argv/oss-fuzz-70153
Normal file
BIN
test/fuzz/fuzz-systemctl-parse-argv/oss-fuzz-70153
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user