Blame SOURCES/0179-tests-keep-SYS_PTRACE-when-running-under-ASan.patch

a3e2b5
From ee93272cf9915710251704c7bf7c1f1a0b02cb7f Mon Sep 17 00:00:00 2001
a3e2b5
From: Frantisek Sumsal <frantisek@sumsal.cz>
a3e2b5
Date: Fri, 9 Nov 2018 12:47:30 +0100
a3e2b5
Subject: [PATCH] tests: keep SYS_PTRACE when running under ASan
a3e2b5
a3e2b5
(cherry picked from commit 7a3025658836c536f81fdd742fa338545294f5bf)
a3e2b5
a3e2b5
Resolves: #1683319
a3e2b5
---
a3e2b5
 src/test/test-capability.c | 7 ++++++-
a3e2b5
 1 file changed, 6 insertions(+), 1 deletion(-)
a3e2b5
a3e2b5
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
a3e2b5
index 72975cef94..20eb877a3c 100644
a3e2b5
--- a/src/test/test-capability.c
a3e2b5
+++ b/src/test/test-capability.c
a3e2b5
@@ -19,8 +19,13 @@
a3e2b5
 static uid_t test_uid = -1;
a3e2b5
 static gid_t test_gid = -1;
a3e2b5
 
a3e2b5
+#ifdef __SANITIZE_ADDRESS__
a3e2b5
+/* Keep CAP_SYS_PTRACE when running under Address Sanitizer */
a3e2b5
+static const uint64_t test_flags = UINT64_C(1) << CAP_SYS_PTRACE;
a3e2b5
+#else
a3e2b5
 /* We keep CAP_DAC_OVERRIDE to avoid errors with gcov when doing test coverage */
a3e2b5
-static uint64_t test_flags = 1ULL << CAP_DAC_OVERRIDE;
a3e2b5
+static const uint64_t test_flags = UINT64_C(1) << CAP_DAC_OVERRIDE;
a3e2b5
+#endif
a3e2b5
 
a3e2b5
 /* verify cap_last_cap() against /proc/sys/kernel/cap_last_cap */
a3e2b5
 static void test_last_cap_file(void) {