1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

core/dbus-manager: refuse SoftReboot() for user managers

Otherwise, busctl --user call ... SoftReboot results in
user manager broadcasting signal and initiating soft-reboot...

(cherry picked from commit 236cd4854657745e1a59b224a191a232a476527e)
This commit is contained in:
Mike Yuan 2024-07-02 18:08:06 +02:00 committed by Luca Boccassi
parent 399e788553
commit efc44e0c3e

View File

@ -1708,6 +1708,10 @@ static int method_soft_reboot(sd_bus_message *message, void *userdata, sd_bus_er
assert(message);
if (!MANAGER_IS_SYSTEM(m))
return sd_bus_error_set(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Soft reboot is only supported by system manager.");
r = verify_run_space_permissive("soft reboot may fail", error);
if (r < 0)
return r;