daandemeyer / rpms / systemd

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