Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test: prevent running the tests as root

  • Loading branch information...
commit 244de4b3e9389d1940ebf143fe6b8f4e540889e2 1 parent 9dd5295
@AvianFlu authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/runner-unix.c
View
5 test/runner-unix.c
@@ -40,6 +40,11 @@
/* Do platform-specific initialization. */
void platform_init(int argc, char **argv) {
+ /* Running the tests as root is not smart - don't do it. */
+ if (getuid() == 0) {
+ fprintf(stderr, "Running the tests as root is not safe.\n");
+ exit(1);
+ }
/* Disable stdio output buffering. */
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
Please sign in to comment.
Something went wrong with that request. Please try again.