diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-10-11 19:12:40 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-10-11 19:12:40 +0000 |
commit | bcc7e348bab289b41ed0186bf440acd112e178fb (patch) | |
tree | 18e7711268e22127cd9dda275431983321f8d680 | |
parent | 4040b36fa79c16747d555b923a13c6eb55c0cab3 (diff) | |
download | FreeBSD-src-bcc7e348bab289b41ed0186bf440acd112e178fb.zip FreeBSD-src-bcc7e348bab289b41ed0186bf440acd112e178fb.tar.gz |
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.
-rw-r--r-- | tools/regression/netinet/ipsockopt/ipsockopt.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); |