diff options
Diffstat (limited to 'usr.bin/ipcs')
-rw-r--r-- | usr.bin/ipcs/ipcs.c | 6 |
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); |