From 99416b6d4e14163993f2578e1d1579972332c5d5 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Thu, 16 Nov 2023 17:47:47 +0800 Subject: [PATCH] logind-action: check if inhibit_what is valid Fixes #30037 --- src/login/logind-action.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index c1d60af..e678edd 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -172,7 +172,8 @@ static int handle_action_execute( inhibit_operation = handle_action_lookup(handle)->inhibit_what; /* If the actual operation is inhibited, warn and fail */ - if (!ignore_inhibited && + if (inhibit_what_is_valid(inhibit_operation) && + !ignore_inhibited && manager_is_inhibited(m, inhibit_operation, INHIBIT_BLOCK, NULL, false, false, 0, &offending)) { _cleanup_free_ char *comm = NULL, *u = NULL; -- 2.7.4