Skip to content

Find, verify, and analyze leaked credentials

Log error and skip file when stat fails (#296)

Bill Rich33aa6f9cab7f
diff --git a/pkg/sources/filesystem/filesystem.go b/pkg/sources/filesystem/filesystem.go
index 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) err
path := 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
}