From: Mike Yuan Date: Sat, 13 Jan 2024 21:14:42 +0000 (+0800) Subject: logind-dbus: refuse multiple jobs in method_do_shutdown_or_sleep too X-Git-Tag: v256-rc1~1161^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3eb8acda96eb99d45eef42fa8c5d035180d0b25a;p=thirdparty%2Fsystemd.git logind-dbus: refuse multiple jobs in method_do_shutdown_or_sleep too Fixes #30917 --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 2b993fd842f..932eb42b4e8 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2128,6 +2128,12 @@ static int method_do_shutdown_or_sleep( if (r != 0) return r; + if (m->delayed_action) + return sd_bus_error_setf(error, BUS_ERROR_OPERATION_IN_PROGRESS, + "Action %s already in progress, refusing requested %s operation.", + handle_action_to_string(m->delayed_action->handle), + handle_action_to_string(a->handle)); + /* reset case we're shorting a scheduled shutdown */ m->unlink_nologin = false; reset_scheduled_shutdown(m);