Skip to content

Commit

Permalink
use lstat when checking whether file is a symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Nov 3, 2021
1 parent a0402b4 commit 0c666d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/backup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 0c666d0

Please sign in to comment.