summaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-08 22:14:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-08 22:14:38 +0000
commitc42d3dfc6a3f99fbbe1a0c87af2f3705ea3ce262 (patch)
treeb2801e83b20e253f4a46ba0d4341d06e3695199c /usr.bin/w
parent5d7745af6274ad1c61f601a05048c86ed26cf8a9 (diff)
whack kmem gid after kvm_openfiles()
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/w.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 72c8a01ddf5..72297091204 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w.c,v 1.24 1998/02/03 19:18:22 deraadt Exp $ */
+/* $OpenBSD: w.c,v 1.25 1998/07/08 22:14:20 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#else
-static char *rcsid = "$OpenBSD: w.c,v 1.24 1998/02/03 19:18:22 deraadt Exp $";
+static char *rcsid = "$OpenBSD: w.c,v 1.25 1998/07/08 22:14:20 deraadt Exp $";
#endif
#endif /* not lint */
@@ -187,6 +187,9 @@ main(argc, argv)
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL)
errx(1, "%s", errbuf);
+ setegid(getgid());
+ setgid(getgid());
+
(void)time(&now);
if ((ut = fopen(_PATH_UTMP, "r")) == NULL)
err(1, "%s", _PATH_UTMP);