daandemeyer / rpms / systemd

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