From 617c295ec0e0454cbc723a148ed4aadc0b631653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sat, 22 Aug 2020 15:19:43 +0200 Subject: Lock file names must be absolute --- internal/feed/cache.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/feed/cache.go b/internal/feed/cache.go index 2d8f9aa..4453246 100644 --- a/internal/feed/cache.go +++ b/internal/feed/cache.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "os" + "path/filepath" "time" "github.com/nightlyone/lockfile" @@ -51,12 +52,16 @@ func cacheForVersion(version Version) (CacheImpl, error) { } } -func lockName(fileName string) string { - return fileName + ".lck" +func lockName(fileName string) (string, error) { + return filepath.Abs(fileName + ".lck") } func lock(fileName string) (lock lockfile.Lockfile, err error) { - lockFile := lockName(fileName) + var lockFile string + + if lockFile, err = lockName(fileName); err != nil { + return + } log.Debugf("Handling lock file '%s'", lockFile) if lock, err = lockfile.New(lockFile); err != nil { -- cgit v1.2.3