summaryrefslogtreecommitdiff
path: root/sbin
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 /sbin
parent5d7745af6274ad1c61f601a05048c86ed26cf8a9 (diff)
whack kmem gid after kvm_openfiles()
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dmesg/dmesg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c
index dd5edb3ba45..7643ce9ce8c 100644
--- a/sbin/dmesg/dmesg.c
+++ b/sbin/dmesg/dmesg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dmesg.c,v 1.6 1998/07/05 18:45:17 deraadt Exp $ */
+/* $OpenBSD: dmesg.c,v 1.7 1998/07/08 22:14:37 deraadt Exp $ */
/* $NetBSD: dmesg.c,v 1.8 1995/03/18 14:54:49 cgd Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)dmesg.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: dmesg.c,v 1.6 1998/07/05 18:45:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: dmesg.c,v 1.7 1998/07/08 22:14:37 deraadt Exp $";
#endif
#endif /* not lint */
@@ -113,6 +113,10 @@ main(argc, argv)
/* Read in kernel message buffer, do sanity checks. */
if ((kd = kvm_open(nlistf, memf, NULL, O_RDONLY, "dmesg")) == NULL)
exit (1);
+
+ setegid(getgid());
+ setgid(getgid());
+
if (kvm_nlist(kd, nl) == -1)
errx(1, "kvm_nlist: %s", kvm_geterr(kd));
if (nl[X_MSGBUF].n_type == 0)