Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/net explain what's going on before we fix it.



details:   https://anonhg.NetBSD.org/src/rev/62985d698a88
branches:  trunk
changeset: 829892:62985d698a88
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 16 16:30:20 2018 +0000

description:
explain what's going on before we fix it.

diffstat:

 tests/net/net/t_tcp.c  |  7 ++++---
 tests/net/net/t_unix.c |  6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (60 lines):

diff -r 74c3dab01fea -r 62985d698a88 tests/net/net/t_tcp.c
--- a/tests/net/net/t_tcp.c     Fri Feb 16 16:23:15 2018 +0000
+++ b/tests/net/net/t_tcp.c     Fri Feb 16 16:30:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_tcp.c,v 1.7 2018/02/16 16:23:15 christos Exp $       */
+/*     $NetBSD: t_tcp.c,v 1.8 2018/02/16 16:30:20 christos Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$Id: t_tcp.c,v 1.7 2018/02/16 16:23:15 christos Exp $");
+__RCSID("$Id: t_tcp.c,v 1.8 2018/02/16 16:30:20 christos Exp $");
 #endif
 
 /* Example code. Should block; does with accept not paccept. */
@@ -182,12 +182,13 @@
                FAIL("fnctl setfl");
 #endif
 
+       /* This is supposed to only work on Unix sockets but returns garbage */
        if (getpeereid(clnt, &euid, &egid) == -1)
                FAIL("getpeereid(clnt)");
        CHECK_EQUAL(euid, geteuid(), "client");
        CHECK_EQUAL(egid, getegid(), "client");
 
-       /* This is not symmetric? */
+       /* This is supposed to only work on Unix sockets but returns garbage */
        if (getpeereid(srvr, &euid, &egid) == -1)
                FAIL("getpeereid(srvr)");
        CHECK_EQUAL(euid, geteuid(), "server");
diff -r 74c3dab01fea -r 62985d698a88 tests/net/net/t_unix.c
--- a/tests/net/net/t_unix.c    Fri Feb 16 16:23:15 2018 +0000
+++ b/tests/net/net/t_unix.c    Fri Feb 16 16:30:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_unix.c,v 1.13 2018/02/16 16:23:15 christos Exp $     */
+/*     $NetBSD: t_unix.c,v 1.14 2018/02/16 16:30:20 christos Exp $     */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$Id: t_unix.c,v 1.13 2018/02/16 16:23:15 christos Exp $");
+__RCSID("$Id: t_unix.c,v 1.14 2018/02/16 16:30:20 christos Exp $");
 #else
 #define getprogname() argv[0]
 #endif
@@ -183,7 +183,7 @@
        CHECK_EQUAL(egid, getegid(), "client");
 
 #if 0
-       /* This is not symmetric? */
+       /* This is not symmetric? It is supposed to work! */
        if (getpeereid(srvr, &euid, &egid) == -1)
                FAIL("getpeereid(srvr)");
        CHECK_EQUAL(euid, geteuid(), "server");



Home | Main Index | Thread Index | Old Index