From 0336b6e38552aca20a3fce24786b1474437d7ec0 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 15 Aug 1996 03:53:48 +0000 Subject: [PATCH] call seteuid() before append/create. from kstailey (PR#2699) --- larn/scores.c | 8 ++++---- 1 file 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) -- 2.47.1