diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-22 03:29:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-22 03:29:13 +0000 |
commit | c685da080d7d6ef4da40968519030fcf518289f4 (patch) | |
tree | 3d3c481aab15688149f43911b9e9fa5b610d15b9 /usr.sbin/trsp/trsp.c | |
parent | b9e51bce4b9f1693731b39bfbb2873af2e60d83c (diff) |
Deal with _POSIX_SAVED_IDS when relinquishing privileges
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); |