Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
test: prevent running the tests as root
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu authored and bnoordhuis committed Jun 25, 2012
1 parent 7573f4a commit f3fd8e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/runner-unix.c
Expand Up @@ -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);
Expand Down

0 comments on commit f3fd8e3

Please sign in to comment.