common.h (1fa335209f6ad9d554655bb802c5b49b855d6237) | common.h (a549d055a22e4fc5559ef642b30721899fa07b75) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Landlock test helpers 4 * 5 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> 6 * Copyright © 2019-2020 ANSSI 7 * Copyright © 2021 Microsoft Corporation 8 */ --- 98 unchanged lines hidden (view full) --- 107} 108#endif 109 110static void _init_caps(struct __test_metadata *const _metadata, bool drop_all) 111{ 112 cap_t cap_p; 113 /* Only these three capabilities are useful for the tests. */ 114 const cap_value_t caps[] = { | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Landlock test helpers 4 * 5 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> 6 * Copyright © 2019-2020 ANSSI 7 * Copyright © 2021 Microsoft Corporation 8 */ --- 98 unchanged lines hidden (view full) --- 107} 108#endif 109 110static void _init_caps(struct __test_metadata *const _metadata, bool drop_all) 111{ 112 cap_t cap_p; 113 /* Only these three capabilities are useful for the tests. */ 114 const cap_value_t caps[] = { |
115 /* clang-format off */ |
|
115 CAP_DAC_OVERRIDE, 116 CAP_MKNOD, 117 CAP_SYS_ADMIN, 118 CAP_SYS_CHROOT, | 116 CAP_DAC_OVERRIDE, 117 CAP_MKNOD, 118 CAP_SYS_ADMIN, 119 CAP_SYS_CHROOT, |
120 CAP_NET_BIND_SERVICE, 121 /* clang-format on */ |
|
119 }; 120 121 cap_p = cap_get_proc(); 122 EXPECT_NE(NULL, cap_p) 123 { 124 TH_LOG("Failed to cap_get_proc: %s", strerror(errno)); 125 } 126 EXPECT_NE(-1, cap_clear(cap_p)) --- 142 unchanged lines hidden --- | 122 }; 123 124 cap_p = cap_get_proc(); 125 EXPECT_NE(NULL, cap_p) 126 { 127 TH_LOG("Failed to cap_get_proc: %s", strerror(errno)); 128 } 129 EXPECT_NE(-1, cap_clear(cap_p)) --- 142 unchanged lines hidden --- |