frontend: avoid RW access to TEAMS dir by placing startedFile into submissions
This commit is contained in:
parent
df5c9532cd
commit
def822cd45
2 changed files with 5 additions and 4 deletions
|
@ -22,7 +22,7 @@ var TmpSubmissionDir string
|
|||
var touchTimer *time.Timer = nil
|
||||
|
||||
func touchStartedFile() {
|
||||
if fd, err := os.Create(path.Join(TeamsDir, startedFile)); err == nil {
|
||||
if fd, err := os.Create(path.Join(SubmissionDir, startedFile)); err == nil {
|
||||
log.Println("Started! Go, Go, Go!!")
|
||||
fd.Close()
|
||||
} else {
|
||||
|
@ -39,8 +39,8 @@ func reloadSettings(config settings.FICSettings) {
|
|||
if startSub > 0 {
|
||||
log.Println("Challenge will starts at", config.Start, "in", startSub)
|
||||
|
||||
if _, err := os.Stat(path.Join(TeamsDir, startedFile)); !os.IsNotExist(err) {
|
||||
os.Remove(path.Join(TeamsDir, startedFile))
|
||||
if _, err := os.Stat(path.Join(SubmissionDir, startedFile)); !os.IsNotExist(err) {
|
||||
os.Remove(path.Join(SubmissionDir, startedFile))
|
||||
}
|
||||
|
||||
touchTimer = time.AfterFunc(config.Start.Sub(time.Now().Add(time.Duration(1 * time.Second))), touchStartedFile)
|
||||
|
|
Reference in a new issue