From: Mike Yuan Date: Thu, 16 Nov 2023 09:47:47 +0000 (+0800) Subject: logind-action: check if inhibit_what is valid X-Git-Tag: v255-rc3~47^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30055%2Fhead;p=thirdparty%2Fsystemd.git logind-action: check if inhibit_what is valid Fixes #30037 --- diff --git a/src/login/logind-action.c b/src/login/logind-action.c index c1d60af7591..e678edd66fb 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;