mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
systemctl: refuse to acquire dbus connection with --global
Maybe, better to check the runtime scope each verb for better log message, but this is a good start point to not trigger assertion. Fixes oss-fuzz#56915 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56915). Fixes #26402 and #26754.
This commit is contained in:
parent
560900be67
commit
d77d42ed3a
@ -36,6 +36,9 @@ int acquire_bus(BusFocus focus, sd_bus **ret) {
|
|||||||
assert(focus < _BUS_FOCUS_MAX);
|
assert(focus < _BUS_FOCUS_MAX);
|
||||||
assert(ret);
|
assert(ret);
|
||||||
|
|
||||||
|
if (!IN_SET(arg_runtime_scope, RUNTIME_SCOPE_SYSTEM, RUNTIME_SCOPE_USER))
|
||||||
|
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--global is not supported for this operation.");
|
||||||
|
|
||||||
/* We only go directly to the manager, if we are using a local transport */
|
/* We only go directly to the manager, if we are using a local transport */
|
||||||
if (arg_transport != BUS_TRANSPORT_LOCAL)
|
if (arg_transport != BUS_TRANSPORT_LOCAL)
|
||||||
focus = BUS_FULL;
|
focus = BUS_FULL;
|
||||||
|
BIN
test/fuzz/fuzz-systemctl-parse-argv/oss-fuzz-56915
Normal file
BIN
test/fuzz/fuzz-systemctl-parse-argv/oss-fuzz-56915
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user