summaryrefslogtreecommitdiff
path: root/bin/ps
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 6e4b70e89b5..9d7d64e3da3 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.6 1996/12/14 12:18:10 mickey Exp $ */
+/* $OpenBSD: ps.c,v 1.7 1996/12/22 02:57:50 tholo Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: ps.c,v 1.6 1996/12/14 12:18:10 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.7 1996/12/22 02:57:50 tholo Exp $";
#endif
#endif /* not lint */
@@ -267,8 +267,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 || swapf != NULL)
+ if (nlistf != NULL || memf != NULL || swapf != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf);
if (kd == 0)