From 236cd4854657745e1a59b224a191a232a476527e Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Tue, 2 Jul 2024 18:08:06 +0200 Subject: [PATCH] core/dbus-manager: refuse SoftReboot() for user managers Otherwise, busctl --user call ... SoftReboot results in user manager broadcasting signal and initiating soft-reboot... --- src/core/dbus-manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index ddc721f5d19..3d2796f2c41 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -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; -- 2.47.3