From: Erik van der Kouwe Date: Tue, 18 Aug 2009 19:58:34 +0000 (+0000) Subject: Use su to allow tests 3, 6, 17, 18, 19, 21 and 25 to work as root, making testing... X-Git-Tag: v3.1.5~177 X-Git-Url: http://zhaoyanbai.com/repos/man.genrandom.html?a=commitdiff_plain;h=5cdd995dc5b3ceee62f891b8f44cb11c0f2bca10;p=minix.git Use su to allow tests 3, 6, 17, 18, 19, 21 and 25 to work as root, making testing easier --- diff --git a/test/test17.c b/test/test17.c index 92d5263dd..18c3b80e3 100644 --- a/test/test17.c +++ b/test/test17.c @@ -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); } diff --git a/test/test18.c b/test/test18.c index 246b15806..18eb0f3d1 100644 --- a/test/test18.c +++ b/test/test18.c @@ -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); } diff --git a/test/test19.c b/test/test19.c index 4d990057d..911540b62 100644 --- a/test/test19.c +++ b/test/test19.c @@ -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); } diff --git a/test/test21.c b/test/test21.c index c46989a18..e437b8349 100644 --- a/test/test21.c +++ b/test/test21.c @@ -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); } diff --git a/test/test25.c b/test/test25.c index 42c86fe8e..0136bc8d7 100644 --- a/test/test25.c +++ b/test/test25.c @@ -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); } diff --git a/test/test3.c b/test/test3.c index d3e6a8e83..4dc847022 100644 --- a/test/test3.c +++ b/test/test3.c @@ -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); } diff --git a/test/test6.c b/test/test6.c index 489c5784a..e0012d88f 100644 --- a/test/test6.c +++ b/test/test6.c @@ -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); }