From 8ad3ce721e0bc4b75588ba639a0a7abc2e4558d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 22 Jan 2024 14:55:00 +0100 Subject: [PATCH] checkpolicy: bail out on invalid role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return early on invalid roles in user definition. Signed-off-by: Christian Göttsche Acked-by: James Carter --- checkpolicy/policy_define.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c index 97582630..44236797 100644 --- a/checkpolicy/policy_define.c +++ b/checkpolicy/policy_define.c @@ -4244,7 +4244,7 @@ int define_user(void) while ((id = queue_remove(id_queue))) { if (set_user_roles(&usrdatum->roles, id)) - continue; + return -1; } if (mlspol) {