explain what's going on before we fix it.

This commit is contained in:
christos 2018-02-16 16:30:20 +00:00
parent 474def7698
commit e34e5e3adb
2 changed files with 7 additions and 6 deletions

View File

@ -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 @@ again:
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");

View File

@ -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 @@ test(bool closeit, size_t len)
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");