Use su to allow tests 3, 6, 17, 18, 19, 21 and 25 to work as root, making testing easier
This commit is contained in:
parent
192c0be4a8
commit
5cdd995dc5
7 changed files with 8 additions and 0 deletions
|
@ -123,6 +123,7 @@ char *argv[];
|
|||
|
||||
sync();
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test17", NULL);
|
||||
printf("Test 17 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ int main()
|
|||
int n;
|
||||
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test18", NULL);
|
||||
printf("Test 18 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ char *argv[];
|
|||
m = (argc == 2 ? atoi(argv[1]) : 0xFFFF);
|
||||
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test19", NULL);
|
||||
printf("Test 19 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ char *argv[];
|
|||
|
||||
sync();
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test21", NULL);
|
||||
printf("Test 21 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ char *argv[];
|
|||
|
||||
sync();
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test25", NULL);
|
||||
printf("Test 25 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,9 @@ char *argv[];
|
|||
int i, m = 0xFFFF;
|
||||
|
||||
sync();
|
||||
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test3", NULL);
|
||||
printf("Test 3 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ char *argv[];
|
|||
|
||||
sync();
|
||||
if (geteuid() == 0 || getuid() == 0) {
|
||||
execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test6", NULL);
|
||||
printf("Test 6 cannot run as root; test aborted\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue