From ba1922e360028e00b0ecadd02bb51f723c22ce67 Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 3 Feb 2008 03:45:55 +0000 Subject: Since games are (now) setgid, not setuid, it is no longer necessary to manipulate the effective uid, only the effective gid. --- larn/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'larn/main.c') diff --git a/larn/main.c b/larn/main.c index a7027b70..288a8f8b 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,9 +1,9 @@ -/* $NetBSD: main.c,v 1.20 2008/01/28 05:38:54 dholland Exp $ */ +/* $NetBSD: main.c,v 1.21 2008/02/03 03:45:55 dholland Exp $ */ /* main.c */ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.20 2008/01/28 05:38:54 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2008/02/03 03:45:55 dholland Exp $"); #endif /* not lint */ #include @@ -20,7 +20,7 @@ int srcount = 0; /* line counter for showstr() */ int dropflag = 0; /* if 1 then don't lookforobject() next round */ int rmst = 80; /* random monster creation counter */ int userid; /* the players login user id number */ -uid_t uid, euid; /* used for security */ +gid_t gid, egid; /* used for security */ u_char nowelcome = 0, nomove = 0; /* if (nomove) then don't * count next iteration as a * move */ @@ -63,9 +63,9 @@ main(argc, argv) struct passwd *pwe; i = 0; - euid = geteuid(); - uid = getuid(); - seteuid(uid); /* give up "games" if we have it */ + egid = getegid(); + gid = getgid(); + setegid(gid); /* give up "games" if we have it */ /* * first task is to identify the player */ -- cgit v1.2.3