[compiler-rt] [sanitizer] Fix running sanitizer_bad_report_path_test on Linux as root (PR #97732)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 07:11:38 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 0035c2efad8fd7b4dbd01efbc573999f7b91b0d5 ad37d3b917309c736118f8855125fd168d1cadc6 -- compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_bad_report_path_test.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_bad_report_path_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_bad_report_path_test.cpp
index a7312341b6..4fb247c175 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_bad_report_path_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_bad_report_path_test.cpp
@@ -14,7 +14,7 @@
#include <string.h>
#if defined(__linux__)
-#include <linux/capability.h>
+# include <linux/capability.h>
/* Use capget() and capset() from glibc. */
extern "C" int capget(cap_user_header_t header, cap_user_data_t data);
@@ -22,8 +22,8 @@ extern "C" int capset(cap_user_header_t header, const cap_user_data_t data);
static void try_drop_cap_dac_override(void) {
struct __user_cap_header_struct hdr = {
- .version = _LINUX_CAPABILITY_VERSION_1,
- .pid = 0,
+ .version = _LINUX_CAPABILITY_VERSION_1,
+ .pid = 0,
};
struct __user_cap_data_struct data[_LINUX_CAPABILITY_U32S_1];
if (!capget(&hdr, data)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/97732
More information about the llvm-commits
mailing list