summaryrefslogtreecommitdiff
path: root/games/larn/main.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 04:45:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 04:45:31 +0000
commit7b4cbf83946cbb91e3fd2bf61fe046dfd5c4ee5f (patch)
treeb5f687fc83f229a41b2f9ca21efa88f9abdb089d /games/larn/main.c
parentd33c9b2df3efffe546c33096d0a3122edf923b40 (diff)
security fixes
Diffstat (limited to 'games/larn/main.c')
-rw-r--r--games/larn/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/games/larn/main.c b/games/larn/main.c
index fa7c3683bcd..e80b154908b 100644
--- a/games/larn/main.c
+++ b/games/larn/main.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$NetBSD: main.c,v 1.7 1995/04/24 12:24:01 cgd Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.7.6.1 1996/05/27 15:54:26 mrg Exp $";
#endif /* not lint */
/* main.c */
@@ -13,6 +13,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 */
char nowelcome=0,nomove=0; /* if (nomove) then don't count next iteration as a move */
static char viewflag=0;
/* if viewflag then we have done a 99 stay here and don't showcell in the main loop */
@@ -48,6 +49,9 @@ main(argc,argv)
char *ptr=0,*ttype;
struct passwd *pwe;
+ euid = geteuid();
+ uid = getuid();
+ seteuid(uid); /* give up "games" if we have it */
/*
* first task is to identify the player
*/