mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
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:
1 file changed
+4
@@ -535,6 +535,10 @@ static int manager_signal(link_call_t *call, void *u)
|
|||||||
static int manager_suspend(link_call_t *call, void *u)
|
static int manager_suspend(link_call_t *call, void *u)
|
||||||
{
|
{
|
||||||
(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();
|
sync();
|
||||||
if (suspend() < 0) {
|
if (suspend() < 0) {
|
||||||
const char *msg = (errno == EINVAL)
|
const char *msg = (errno == EINVAL)
|
||||||
|
|||||||
Reference in new issue
Block a user