frontend: avoid RW access to TEAMS dir by placing startedFile into submissions

This commit is contained in:
nemunaire 2017-11-10 20:53:49 +01:00 committed by Pierre-Olivier Mercier
parent 67bdab73fc
commit 0028650519
2 changed files with 5 additions and 4 deletions

View file

@ -14,7 +14,7 @@ import (
// Check if the challenge is started or not
func isStarted() bool {
if _, err := os.Stat(path.Join(TeamsDir, "started")); os.IsNotExist(err) {
if _, err := os.Stat(path.Join(SubmissionDir, "started")); os.IsNotExist(err) {
return false
}
return true
@ -38,6 +38,7 @@ func genTeamMyFile(team fic.Team) error {
return err
}
// Speed up generation when challenge is started
if !isStarted() {
if my, err := fic.MyJSONTeam(&team, false); err != nil {
return err