summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authormax <max@FreeBSD.org>1997-01-30 01:29:28 +0000
committermax <max@FreeBSD.org>1997-01-30 01:29:28 +0000
commit9abde98e48517e3405eb80002fc52d9a1fd27bb5 (patch)
tree91f87d9f123f5665bb43cbe856fc4908719e47d4 /games
parent0340159e079dbcdc5571fbc408c65cb278d8ff02 (diff)
downloadFreeBSD-src-9abde98e48517e3405eb80002fc52d9a1fd27bb5.zip
FreeBSD-src-9abde98e48517e3405eb80002fc52d9a1fd27bb5.tar.gz
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.
Diffstat (limited to 'games')
-rw-r--r--games/backgammon/common_source/save.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c
index b25e194..61cdd8e 100644
--- a/games/backgammon/common_source/save.c
+++ b/games/backgammon/common_source/save.c
@@ -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);
OpenPOWER on IntegriCloud