teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame 0234-core-smack-setup-Actually-allow-for-succesfully-load.patch

Zbigniew Jędrzejewski-Szmek 62fe94
From b9289d4c6e13ec5fb67bfce69c826d93b004da6a Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 62fe94
From: Philippe De Swert <philippedeswert@gmail.com>
Zbigniew Jędrzejewski-Szmek 62fe94
Date: Fri, 12 Sep 2014 16:49:48 +0300
Zbigniew Jędrzejewski-Szmek 62fe94
Subject: [PATCH] core: smack-setup: Actually allow for succesfully loading
Zbigniew Jędrzejewski-Szmek 62fe94
 CIPSO policy
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
The line under the last switch statement  *loaded_policy = true;
Zbigniew Jędrzejewski-Szmek 62fe94
would never be executed. As all switch cases return 0. Thus the
Zbigniew Jędrzejewski-Szmek 62fe94
policy would never be marked as loaded.
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
Found with Coverity. Fixes: CID#1237785
Zbigniew Jędrzejewski-Szmek 62fe94
---
Zbigniew Jędrzejewski-Szmek 62fe94
 src/core/smack-setup.c | 2 +-
Zbigniew Jędrzejewski-Szmek 62fe94
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
Zbigniew Jędrzejewski-Szmek 62fe94
index 5f6dabf82a..5d8a26c61d 100644
Zbigniew Jędrzejewski-Szmek 62fe94
--- a/src/core/smack-setup.c
Zbigniew Jędrzejewski-Szmek 62fe94
+++ b/src/core/smack-setup.c
Zbigniew Jędrzejewski-Szmek 62fe94
@@ -158,7 +158,7 @@ int smack_setup(bool *loaded_policy) {
Zbigniew Jędrzejewski-Szmek 62fe94
                 return 0;
Zbigniew Jędrzejewski-Szmek 62fe94
         case 0:
Zbigniew Jędrzejewski-Szmek 62fe94
                 log_info("Successfully loaded Smack/CIPSO policies.");
Zbigniew Jędrzejewski-Szmek 62fe94
-                return 0;
Zbigniew Jędrzejewski-Szmek 62fe94
+                break;
Zbigniew Jędrzejewski-Szmek 62fe94
         default:
Zbigniew Jędrzejewski-Szmek 62fe94
                 log_warning("Failed to load Smack/CIPSO access rules: %s, ignoring.",
Zbigniew Jędrzejewski-Szmek 62fe94
                             strerror(abs(r)));