From 0c666d0c880a8f621c72010fdf8446a0e6cda11c Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 3 Nov 2021 18:07:55 +0100 Subject: [PATCH] use lstat when checking whether file is a symlink --- cmd/backup/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/backup/main.go b/cmd/backup/main.go index a902b84a..a920d2c0 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -518,10 +518,10 @@ func (s *script) pruneOldBackups() error { var candidates []string for _, candidate := range globMatches { - fi, err := os.Stat(candidate) + fi, err := os.Lstat(candidate) if err != nil { return fmt.Errorf( - "pruneOldBackups: error calling stat on file %s: %w", + "pruneOldBackups: error calling Lstat on file %s: %w", candidate, err, )