Do not allow path to escape the alloc dir for the FS commands

This commit is contained in:
Alex Dadgar
2016-10-03 14:58:44 -07:00
parent 96038e85cc
commit bcb1a2e216
4 changed files with 89 additions and 8 deletions

View File

@@ -856,7 +856,13 @@ func blockUntilNextLog(fs allocdir.AllocDirFS, t *tomb.Tomb, logPath, task, logT
next := make(chan error, 1)
go func() {
eofCancelCh := fs.BlockUntilExists(nextPath, t)
eofCancelCh, err := fs.BlockUntilExists(nextPath, t)
if err != nil {
next <- err
close(next)
return
}
scanCh := time.Tick(nextLogCheckRate)
for {
select {