mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
chore: log skipped symlinks (#1591)
This commit is contained in:
1 parent
d03d6c401b
commit
5407c44e0c
2 files changed
+16
-9
No files matched your search
@@ -1,12 +1,12 @@
|
||||
package sources
|
||||
|
||||
import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/fatih/semgroup"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type ScanTarget struct {
|
||||
@@ -35,7 +35,12 @@ func DirectoryTargets(source string, s *semgroup.Group, followSymlinks bool) (<-
|
||||
Symlink: "",
|
||||
}
|
||||
}
|
||||
if fInfo.Mode().Type() == fs.ModeSymlink && followSymlinks {
|
||||
if fInfo.Mode().Type() == fs.ModeSymlink {
|
||||
if !followSymlinks {
|
||||
log.Debug().Str("path", path).Msg("Skipping symlink")
|
||||
return nil
|
||||
}
|
||||
|
||||
realPath, err := filepath.EvalSymlinks(path)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user