From c95bccb936556e0fd39a029d1dcd998c0691187d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 1 May 2005 02:43:13 +0000 Subject: use setresgid() to drop privs, it is simply a better and less ambiguous API; ok deraadt@ and millert@ a while ago, more to come --- games/atc/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'games/atc') diff --git a/games/atc/main.c b/games/atc/main.c index 172417f47f8..f2f07e60e7c 100644 --- a/games/atc/main.c +++ b/games/atc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.12 2004/11/29 08:52:28 jsg Exp $ */ +/* $OpenBSD: main.c,v 1.13 2005/05/01 02:43:11 djm Exp $ */ /* $NetBSD: main.c,v 1.4 1995/04/27 21:22:25 mycroft Exp $ */ /*- @@ -52,7 +52,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.12 2004/11/29 08:52:28 jsg Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.13 2005/05/01 02:43:11 djm Exp $"; #endif #endif /* not lint */ @@ -67,6 +67,7 @@ main(int ac, char *av[]) const char *file = NULL; char *name, *ptr, *seed; struct sigaction sa; + gid_t gid; #ifdef BSD struct itimerval itv; #endif @@ -74,8 +75,8 @@ main(int ac, char *av[]) open_score_file(); /* revoke privs */ - setegid(getgid()); - setgid(getgid()); + gid = getgid(); + setresgid(gid, gid, gid); start_time = time(0); makenoise = 1; -- cgit v1.2.3