diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-05-03 01:01:16 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-05-03 01:01:16 +0000 |
commit | 6e3d4669e24109b707ee132715b0e72c4f4049ab (patch) | |
tree | 35cdb910d7fd60d0b1c36c4322665398cb0ea552 /usr.sbin/traceroute6 | |
parent | d7a12bc06a5691c87253eb610bad11c519521e3a (diff) |
more setres[ug]id; ok deraadt@
Diffstat (limited to 'usr.sbin/traceroute6')
-rw-r--r-- | usr.sbin/traceroute6/traceroute6.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c index 11ff359a237..66b4a34a668 100644 --- a/usr.sbin/traceroute6/traceroute6.c +++ b/usr.sbin/traceroute6/traceroute6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute6.c,v 1.38 2004/08/01 18:32:21 deraadt Exp $ */ +/* $OpenBSD: traceroute6.c,v 1.39 2005/05/03 01:01:14 djm Exp $ */ /* $KAME: traceroute6.c,v 1.63 2002/10/24 12:53:25 itojun Exp $ */ /* @@ -364,6 +364,7 @@ main(int argc, char *argv[]) u_long probe, hops, lport; struct hostent *hp; size_t size; + uid_t uid; /* * Receive ICMP @@ -374,8 +375,9 @@ main(int argc, char *argv[]) } /* revoke privs */ - seteuid(getuid()); - setuid(getuid()); + uid = getuid(); + if (setresuid(uid, uid, uid) == -1) + err(1, "setresuid"); size = sizeof(i); (void) sysctl(mib, sizeof(mib)/sizeof(mib[0]), &i, &size, NULL, 0); |