dbus: refuse Manager1.Suspend in bootstrap and shutdown

The legacy INIT_CMD_SUSPEND is refused in runlevel S, 0, and 6, the
bus method suspended unconditionally, even mid-shutdown.  Add the
same guard, replying WrongRunlevel like the reboot family.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-08-16 22:03:36 +02:00
parent 8138b402a0
commit 8114508bbb
+4
View File
@@ -535,6 +535,10 @@ static int manager_signal(link_call_t *call, void *u)
static int manager_suspend(link_call_t *call, void *u)
{
(void)u;
if (IS_RESERVED_RUNLEVEL(runlevel))
return link_call_reply_error(call,
"org.finit.Error.WrongRunlevel",
"Unsupported command in runlevel S and 6/0");
sync();
if (suspend() < 0) {
const char *msg = (errno == EINVAL)