ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From 94a42ae477f9b85051baf77322148173689ffa59 Mon Sep 17 00:00:00 2001
923a60
From: Frantisek Sumsal <frantisek@sumsal.cz>
923a60
Date: Thu, 8 Nov 2018 09:40:13 +0100
923a60
Subject: [PATCH] tests: drop the precondition check for inherited flag
923a60
923a60
Docker's default capability set has the inherited flag already
923a60
set - that breaks tests which expect otherwise. Let's just
923a60
drop the check and run the test anyway.
923a60
923a60
Fixes #10663
923a60
923a60
Cherry-picked from: c446b8486d9ed18d1bc780948ae9ee8a53fa4c3f
923a60
---
923a60
 src/test/test-capability.c | 8 --------
923a60
 1 file changed, 8 deletions(-)
923a60
923a60
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
923a60
index 67a9ec2d14..c76bdf20a5 100644
923a60
--- a/src/test/test-capability.c
923a60
+++ b/src/test/test-capability.c
923a60
@@ -160,8 +160,6 @@ static void test_update_inherited_set(void) {
923a60
 
923a60
         caps = cap_get_proc();
923a60
         assert_se(caps);
923a60
-        assert_se(!cap_get_flag(caps, CAP_CHOWN, CAP_INHERITABLE, &fv));
923a60
-        assert(fv == CAP_CLEAR);
923a60
 
923a60
         set = (UINT64_C(1) << CAP_CHOWN);
923a60
 
923a60
@@ -177,12 +175,6 @@ static void test_set_ambient_caps(void) {
923a60
         uint64_t set = 0;
923a60
         cap_flag_value_t fv;
923a60
 
923a60
-        caps = cap_get_proc();
923a60
-        assert_se(caps);
923a60
-        assert_se(!cap_get_flag(caps, CAP_CHOWN, CAP_INHERITABLE, &fv));
923a60
-        assert(fv == CAP_CLEAR);
923a60
-        cap_free(caps);
923a60
-
923a60
         assert_se(prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_CHOWN, 0, 0) == 0);
923a60
 
923a60
         set = (UINT64_C(1) << CAP_CHOWN);