race condition

2013-10-05 Thread Beco
Dear mentors, After implementing the score (using SGID), I have a race condition in my game. The comparisson is between the just scored point with the last point in the top-10. readscore_file2memory(); If(pttop[9]) { printf(Congrats... and stuff\n); reorderscore_memory

Re: race condition

2013-10-05 Thread Russ Allbery
Beco r...@beco.cc writes: After implementing the score (using SGID), I have a race condition in my game. The comparisson is between the just scored point with the last point in the top-10. readscore_file2memory(); If(pttop[9]) { printf(Congrats... and stuff\n); reorderscore_memory

Re: race condition

2013-10-05 Thread Beco
On 5 October 2013 22:30, Russ Allbery r...@debian.org wrote: What would be the standard way to lock the scorefile? fcntl(fd, F_SETLK). See fcntl(2). -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ Thanks Russ, I'll take a lock at it. :) Cheers, Beco. -- Dr

Re: race condition

2013-10-05 Thread Paul Wise
On Sun, Oct 6, 2013 at 8:50 AM, Beco wrote: After implementing the score (using SGID), I have a race condition in my game. Please delete that code and revert to using per-user scores. Making it setgid games just creates a source of vulnerabilities and is strongly discouraged. Please follow