1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00

logind-action: check if inhibit_what is valid

Fixes #30037
This commit is contained in:
Mike Yuan 2023-11-16 17:47:47 +08:00
parent febe81313e
commit 99416b6d4e
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -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;