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:
parent
534fe5414f
commit
85d133dabd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22109
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user