summaryrefslogtreecommitdiff
path: root/usr.sbin/iostat/iostat.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-22 03:29:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-22 03:29:13 +0000
commitc685da080d7d6ef4da40968519030fcf518289f4 (patch)
tree3d3c481aab15688149f43911b9e9fa5b610d15b9 /usr.sbin/iostat/iostat.c
parentb9e51bce4b9f1693731b39bfbb2873af2e60d83c (diff)
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'usr.sbin/iostat/iostat.c')
-rw-r--r--usr.sbin/iostat/iostat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index a591e568729..f038f6e113a 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.5 1996/11/02 00:35:50 millert Exp $ */
+/* $OpenBSD: iostat.c,v 1.6 1996/12/22 03:28:56 deraadt Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -176,8 +176,10 @@ main(argc, argv)
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
- if (nlistf != NULL || memf != NULL)
+ if (nlistf != NULL || memf != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
dkinit(0);
dkreadstats();