diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-10-22 12:24:48 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-10-22 12:24:48 +0000 |
commit | 285d458935bc2f9d8ec1109de01ed66185062349 (patch) | |
tree | ef66891f561b7bbc27119f0bffa58a5dd77971cb /lib/msan/lit_tests/initgroups.cc | |
parent | 137a9b84c25f1ad7d68a14f138cf270a03a738cb (diff) | |
download | compiler-rt-285d458935bc2f9d8ec1109de01ed66185062349.tar.gz compiler-rt-285d458935bc2f9d8ec1109de01ed66185062349.tar.bz2 compiler-rt-285d458935bc2f9d8ec1109de01ed66185062349.tar.xz |
[sanitizer] Intercept initgroups.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/lit_tests/initgroups.cc')
-rw-r--r-- | lib/msan/lit_tests/initgroups.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/msan/lit_tests/initgroups.cc b/lib/msan/lit_tests/initgroups.cc new file mode 100644 index 00000000..adba5369 --- /dev/null +++ b/lib/msan/lit_tests/initgroups.cc @@ -0,0 +1,11 @@ +// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t + +#include <sys/types.h> +#include <grp.h> + +int main(void) { + initgroups("root", 0); + // The above fails unless you are root. Does not matter, MSan false positive + // (which we are testing for) happens anyway. + return 0; +} |