diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2018-11-09 12:47:30 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-09 16:26:19 +0100 |
commit | 7a3025658836c536f81fdd742fa338545294f5bf (patch) | |
tree | afebb4d8c918b7f2c0bb44c37ef1d1a75fea0505 /src | |
parent | 3306711ffb28431263ab85b1a2f016b789a1ffaa (diff) | |
download | systemd-7a3025658836c536f81fdd742fa338545294f5bf.tar.gz systemd-7a3025658836c536f81fdd742fa338545294f5bf.tar.bz2 systemd-7a3025658836c536f81fdd742fa338545294f5bf.zip |
tests: keep SYS_PTRACE when running under ASan
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test-capability.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/test-capability.c b/src/test/test-capability.c index 1cca76cb5d..5bfcc385d9 100644 --- a/src/test/test-capability.c +++ b/src/test/test-capability.c @@ -20,8 +20,13 @@ static uid_t test_uid = -1; static gid_t test_gid = -1; +#ifdef __SANITIZE_ADDRESS__ +/* Keep CAP_SYS_PTRACE when running under Address Sanitizer */ +static const uint64_t test_flags = UINT64_C(1) << CAP_SYS_PTRACE; +#else /* We keep CAP_DAC_OVERRIDE to avoid errors with gcov when doing test coverage */ -static uint64_t test_flags = 1ULL << CAP_DAC_OVERRIDE; +static const uint64_t test_flags = UINT64_C(1) << CAP_DAC_OVERRIDE; +#endif /* verify cap_last_cap() against /proc/sys/kernel/cap_last_cap */ static void test_last_cap_file(void) { |