diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-05-01 02:43:13 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-05-01 02:43:13 +0000 |
commit | c95bccb936556e0fd39a029d1dcd998c0691187d (patch) | |
tree | bf587d52b86dbbf6c51b4dc5f672f56e62222f50 /games/battlestar/battlestar.c | |
parent | ddeaac82999e25819a7b555fb4af8b901a6a5aab (diff) |
use setresgid() to drop privs, it is simply a better and less ambiguous API;
ok deraadt@ and millert@ a while ago, more to come
Diffstat (limited to 'games/battlestar/battlestar.c')
-rw-r--r-- | games/battlestar/battlestar.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/games/battlestar/battlestar.c b/games/battlestar/battlestar.c index cd94a6d14d9..fcb961d6453 100644 --- a/games/battlestar/battlestar.c +++ b/games/battlestar/battlestar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: battlestar.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $ */ +/* $OpenBSD: battlestar.c,v 1.15 2005/05/01 02:43:12 djm Exp $ */ /* $NetBSD: battlestar.c,v 1.3 1995/03/21 15:06:47 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)battlestar.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: battlestar.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: battlestar.c,v 1.15 2005/05/01 02:43:12 djm Exp $"; #endif #endif /* not lint */ @@ -61,12 +61,13 @@ main(int argc, char *argv[]) { char mainbuf[LINELENGTH]; char *next; + gid_t gid; open_score_file(); - /* revoke privs. */ - setegid(getgid()); - setgid(getgid()); + /* revoke privs */ + gid = getgid(); + setresgid(gid, gid, gid); if (argc < 2) initialize(NULL); |