diff options
| author | mrg <mrg@NetBSD.org> | 1996-08-15 03:53:48 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 1996-08-15 03:53:48 +0000 |
| commit | 0336b6e38552aca20a3fce24786b1474437d7ec0 (patch) | |
| tree | 4e0266b13f0c6fe3d745d5fd592be0726a43473b /larn/scores.c | |
| parent | 8abf9a302ad3cfee02d06e259308b014dc652f61 (diff) | |
| download | bsdgames-darwin-0336b6e38552aca20a3fce24786b1474437d7ec0.tar.gz bsdgames-darwin-0336b6e38552aca20a3fce24786b1474437d7ec0.zip | |
call seteuid() before append/create. from kstailey (PR#2699)
Diffstat (limited to 'larn/scores.c')
| -rw-r--r-- | larn/scores.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/larn/scores.c b/larn/scores.c index 3a96271c..e1c3fd11 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: scores.c,v 1.6 1996/05/22 00:36:14 mrg Exp $"; +static char rcsid[] = "$NetBSD: scores.c,v 1.7 1996/08/15 03:53:48 mrg Exp $"; #endif /* not lint */ /* scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -516,18 +516,18 @@ invalid: if ((wizard == 0) && (c[GOLD] > 0)) /* wizards can't score */ { #ifndef NOLOG + seteuid(euid); if (lappend(logfile)<0) /* append to file */ { if (lcreat(logfile)<0) /* and can't create new log file */ - { + { lcreat((char*)0); lprcat("\nCan't open record file: I can't post your score.\n"); sncbr(); resetscroll(); lflush(); exit(); } - seteuid(euid); chmod(logfile,0660); - seteuid(uid); } + seteuid(uid); strcpy(logg.who,loginname); logg.score = c[GOLD]; logg.diff = c[HARDGAME]; if (x < 256) |
