From 85d133dabd51391a2a09f9be5185edc27dfb7bed Mon Sep 17 00:00:00 2001 From: Masafumi Max NAKANE Date: Thu, 30 Jan 1997 01:29:28 +0000 Subject: [PATCH] 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. --- games/backgammon/common_source/save.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index b25e19494dc9..61cdd8ec7ac4 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);