# # # patch "tester.cc" # from [38655910140ae01d3c76a292555de0e84a24dcd5] # to [775277ecee57590d0124a8d04f94452668ca34e0] # # patch "testsuite.lua" # from [30b370324e7794c693af1e36ee7360e348a3a868] # to [468554c427354f1b781a7146cfa78b242afa4ddd] # ============================================================ --- tester.cc 38655910140ae01d3c76a292555de0e84a24dcd5 +++ tester.cc 775277ecee57590d0124a8d04f94452668ca34e0 @@ -468,6 +468,24 @@ LUAEXT(timed_wait, ) return 2; } +LUAEXT(require_not_root, ) +{ +#ifdef WIN32 + bool running_as_root = false; +#else + bool running_as_root = !geteuid(); +#endif + // E() doesn't work here, I just get "warning: " in the + // output. Why? + if (running_as_root) + { + P(F("This test suite cannot be run as the root user.\n" + "Please try again with a normal user account.\n")); + exit(1); + } + return 0; +} + int main(int argc, char **argv) { int retcode = 2; ============================================================ --- testsuite.lua 30b370324e7794c693af1e36ee7360e348a3a868 +++ testsuite.lua 468554c427354f1b781a7146cfa78b242afa4ddd @@ -1,5 +1,10 @@ #!./tester +-- We have a bunch of tests that depend on being able to create files or +-- directories that we cannot read or write (mostly to test error handling +-- behavior). +require_not_root() + ostype = string.sub(get_ostype(), 1, string.find(get_ostype(), " ")-1) -- maybe this should go in tester.lua instead?