diff options
Diffstat (limited to 'usr.sbin/trsp/trsp.c')
-rw-r--r-- | usr.sbin/trsp/trsp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/trsp/trsp.c b/usr.sbin/trsp/trsp.c index 566a4ad31c1..ff161d40add 100644 --- a/usr.sbin/trsp/trsp.c +++ b/usr.sbin/trsp/trsp.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)trsp.c 6.8 (Berkeley) 3/2/91";*/ -static char rcsid[] = "$Id: trsp.c,v 1.3 1996/06/03 18:06:23 deraadt Exp $"; +static char rcsid[] = "$Id: trsp.c,v 1.4 1996/12/22 03:29:12 deraadt Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -149,8 +149,11 @@ again: * Discard setgid privileges if not the running kernel so that bad * guys can't print interesting stuff from kernel memory. */ - if (!strcmp(system, _PATH_UNIX) || !strcmp(core, _PATH_KMEM)) + if (!strcmp(system, _PATH_UNIX) || !strcmp(core, _PATH_KMEM)) { + setegid(getgid()); setgid(getgid()); + } + (void) nlist(system, nl); if (nl[0].n_value == 0) { fprintf(stderr, "trsp: %s: no namelist\n", system); |