From bcc7e348bab289b41ed0186bf440acd112e178fb Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 11 Oct 2004 19:12:40 +0000 Subject: Resort unprivileged uid with privileged socket after unprivileged uid with privileged socket in test runs. If running unprivileged and instructed to use unprivileged sockets, don't try and use raw sockets. --- tools/regression/netinet/ipsockopt/ipsockopt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/regression') diff --git a/tools/regression/netinet/ipsockopt/ipsockopt.c b/tools/regression/netinet/ipsockopt/ipsockopt.c index c956e47..265b1e0 100644 --- a/tools/regression/netinet/ipsockopt/ipsockopt.c +++ b/tools/regression/netinet/ipsockopt/ipsockopt.c @@ -682,6 +682,8 @@ testsuite(int priv) */ if (getuid() != 0 && socktype == SOCK_RAW) continue; + if (geteuid() != 0 && !priv && socktype == SOCK_RAW) + continue; /* * XXXRW: On 5.3, this seems not to work for SOCK_RAW. @@ -823,13 +825,13 @@ main(int argc, char *argv[]) if (seteuid(65534) != 0) err(-1, "seteuid(65534)"); fprintf(stderr, - "Running tests with ruid %d euid %d sock uid 0\n", - getuid(), geteuid()); - testsuite(PRIV_GETROOT); - fprintf(stderr, "Running tests with ruid %d euid %d sock uid 65534\n", getuid(), geteuid()); testsuite(PRIV_ASIS); + fprintf(stderr, + "Running tests with ruid %d euid %d sock uid 0\n", + getuid(), geteuid()); + testsuite(PRIV_GETROOT); } fprintf(stderr, "PASS\n"); exit(0); -- cgit v1.1