commit 3a6a6d980d345552ebb6c2dd27b874dbb9794e7d Author: Andrew Bernat Date: Thu Feb 21 13:14:29 2013 -0600 Fix a system crash when running the test suite as root diff --git a/testsuite/src/dyninst/test2_4.C b/testsuite/src/dyninst/test2_4.C index 2920149..1cbb6a6 100644 --- a/testsuite/src/dyninst/test2_4.C +++ b/testsuite/src/dyninst/test2_4.C @@ -68,6 +68,14 @@ extern "C" DLLEXPORT TestMutator *test2_4_factory() { // static int mutatorTest(BPatch *bpatch, bool useAttach) test_results_t test2_4_Mutator::executeTest() { // attach to an a protected pid + +#if !defined(os_windows_test) + if (getuid() == 0 || geteuid() == 0) { + // We're root, there _are_ no protected PIDs + return SKIPPED; + } +#endif + clearError(); BPatch_process *ret = bpatch->processAttach(NULL, 1); int gotError = getError();