richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
a19bc6
From 13b70c13553c94c444f149bd086bd3e8d9cc39b6 Mon Sep 17 00:00:00 2001
a19bc6
From: Evgeny Vereshchagin <evvers@ya.ru>
a19bc6
Date: Thu, 29 Oct 2015 14:13:04 +0300
a19bc6
Subject: [PATCH] core: fix capability bounding set parsing
a19bc6
a19bc6
bug: CapabilityBoundingSet= doesn't reset all caps
a19bc6
a19bc6
Cherry-picked from: 661b37b
a19bc6
Resolves: #1409586
a19bc6
---
a19bc6
 src/core/load-fragment.c | 2 +-
a19bc6
 1 file changed, 1 insertion(+), 1 deletion(-)
a19bc6
a19bc6
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
a19bc6
index 90d42b0..7056419 100644
a19bc6
--- a/src/core/load-fragment.c
a19bc6
+++ b/src/core/load-fragment.c
a19bc6
@@ -1069,7 +1069,7 @@ int config_parse_bounding_set(const char *unit,
a19bc6
                            "Trailing garbage, ignoring.");
a19bc6
 
a19bc6
         capability_bounding_set = invert ? ~sum : sum;
a19bc6
-        if (*capability_bounding_set_drop)
a19bc6
+        if (*capability_bounding_set_drop && capability_bounding_set)
a19bc6
                 *capability_bounding_set_drop = ~(~*capability_bounding_set_drop | capability_bounding_set);
a19bc6
         else
a19bc6
                 *capability_bounding_set_drop = ~capability_bounding_set;