summaryrefslogtreecommitdiff
path: root/usr.bin/ipcs
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:26:11 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:26:11 +0000
commitb9e51bce4b9f1693731b39bfbb2873af2e60d83c (patch)
tree9844363957c023a88374765f72c1a49440395ac5 /usr.bin/ipcs
parenta34740287ce7a6f408b47749029e29e62a63724d (diff)
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'usr.bin/ipcs')
-rw-r--r--usr.bin/ipcs/ipcs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ipcs/ipcs.c b/usr.bin/ipcs/ipcs.c
index 8dcba5ece14..b2344daefec 100644
--- a/usr.bin/ipcs/ipcs.c
+++ b/usr.bin/ipcs/ipcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipcs.c,v 1.5 1996/08/11 00:24:32 deraadt Exp $ */
+/* $OpenBSD: ipcs.c,v 1.6 1996/12/22 03:25:54 tholo Exp $ */
/* $NetBSD: ipcs.c,v 1.10.6.1 1996/06/07 01:53:47 thorpej Exp $ */
/*
@@ -192,8 +192,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 (namelist != NULL || core != NULL)
+ if (namelist != NULL || core != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
if ((kd = kvm_open(namelist, core, NULL, O_RDONLY, "ipcs")) == NULL)
exit(1);