summaryrefslogtreecommitdiff
path: root/usr.sbin/trpt
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/trpt')
-rw-r--r--usr.sbin/trpt/trpt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index 7f5769884cf..3bab7298bd0 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)trpt.c 5.14 (Berkeley) 7/1/91";*/
-static char rcsid[] = "$Id: trpt.c,v 1.3 1996/06/03 18:06:18 deraadt Exp $";
+static char rcsid[] = "$Id: trpt.c,v 1.4 1996/12/22 03:29:10 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -167,8 +167,10 @@ main(argc, argv)
* Discard setgid priviledges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
- if (!strcmp(core, _PATH_KMEM) || !strcmp(system, _PATH_UNIX))
+ if (!strcmp(core, _PATH_KMEM) || !strcmp(system, _PATH_UNIX)) {
+ setegid(getgid());
setgid(getgid());
+ }
if (nlist(system, nl) < 0 || !nl[0].n_value) {
fprintf(stderr, "trpt: %s: no namelist\n", system);