use lstat when checking whether file is a symlink

This commit is contained in:
Frederik Ring 2021-11-03 18:07:55 +01:00
parent a0402b407d
commit 0c666d0c88

View File

@ -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,
)