teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0060-tests-drop-the-precondition-check-for-inherited-flag.patch

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