1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-20 18:04:03 +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...
This commit is contained in:
Mike Yuan 2024-07-02 18:08:06 +02:00
parent 541aadff97
commit 236cd48546
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -1709,6 +1709,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;