diff options
author | mrg <mrg@NetBSD.org> | 1996-05-22 00:36:04 +0000 |
---|---|---|
committer | mrg <mrg@NetBSD.org> | 1996-05-22 00:36:04 +0000 |
commit | 828801324c4d8462b517d534a818131d842ac1fe (patch) | |
tree | 287ae16a5d74464c23106093fdfdcf481c64b575 /larn/main.c | |
parent | 9c906fe8393c2c0fdbad40c90606cefc983a91a0 (diff) | |
download | bsdgames-darwin-828801324c4d8462b517d534a818131d842ac1fe.tar.gz bsdgames-darwin-828801324c4d8462b517d534a818131d842ac1fe.tar.zst bsdgames-darwin-828801324c4d8462b517d534a818131d842ac1fe.zip |
oops, we do need privs. do the right seteuid() thing.
Diffstat (limited to 'larn/main.c')
-rw-r--r-- | larn/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/larn/main.c b/larn/main.c index a17c2099..e691471d 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: main.c,v 1.8 1996/05/21 23:19:20 mrg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.9 1996/05/22 00:36:09 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,7 +49,9 @@ main(argc,argv) char *ptr=0,*ttype; struct passwd *pwe; - setuid(getuid()); /* give up "games" if we have it */ + euid = geteuid(); + uid = getuid(); + seteuid(uid); /* give up "games" if we have it */ /* * first task is to identify the player */ |