test: prevent running the tests as root
This commit is contained in:
parent
7573f4a4c4
commit
f3fd8e3c1b
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user