1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Do getreuid(geteuid(), getuid()) before opening file to save the game and

after closing it.
This fixes bug that user couldn't save the game in progress.
2.2 candidate.
This commit is contained in:
Masafumi Max NAKANE 1997-01-30 01:29:28 +00:00
parent 534fe5414f
commit 85d133dabd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22109

View File

@ -87,6 +87,7 @@ register int n;
writec (*fs++);
}
*fs = '\0';
setreuid(geteuid(), getuid());
if ((fdesc = open(fname,2)) == -1 && errno == 2) {
if ((fdesc = creat (fname,0700)) != -1)
break;
@ -129,6 +130,7 @@ register int n;
write (fdesc,&gvalue,sizeof gvalue);
write (fdesc,&raflag,sizeof raflag);
close (fdesc);
setreuid(geteuid(), getuid());
if (tflag)
curmove (18,0);
writel (saved);