Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Log error and skip file when stat fails (#296)
Bill Rich33aa6f9cab7f
diff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.goindex 9349a1aa7..d67cb830a 100644--- a/pkg/sources/filesystem/filesystem.go+++ b/pkg/sources/filesystem/filesystem.go@@ -96,7 +96,10 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk) errpath := filepath.Join(cleanPath, relativePath)- fileStat, _ := os.Stat(path)+ fileStat, err := os.Stat(path)+ if err != nil {+ log.WithError(err).Warnf("unable to stat file: %s", path)+ }if !fileStat.Mode().IsRegular() {return nil}