From: Mike Yuan Date: Tue, 2 Jul 2024 16:08:06 +0000 (+0200) Subject: core/dbus-manager: refuse SoftReboot() for user managers X-Git-Tag: v257-rc1~986^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=236cd4854657745e1a59b224a191a232a476527e;p=thirdparty%2Fsystemd.git core/dbus-manager: refuse SoftReboot() for user managers Otherwise, busctl --user call ... SoftReboot results in user manager broadcasting signal and initiating soft-reboot... --- 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;