From 8114508bbbae20e4373c2a45bfb9e70159a8326b Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 16 Aug 2026 12:17:40 +0200 Subject: [PATCH] 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 --- src/dbus.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dbus.c b/src/dbus.c index a93f55cd..138bb4a6 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -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)