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

Re: race condition

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

Re: race condition

2013-10-05 Thread Russ Allbery
Beco 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(pt>top[9]) > { > printf("Congrats... and st

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(pt>top[9]) { printf("Congrats... and stuff\n"); reorde