mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
Fix log suppresion issue (#1887)
The check for log suppresion enables archive scanning by default with no max depth.
This commit is contained in:
1 parent
6f251eef65
commit
2463f11e71
1 file changed
+9
-6
+9
-6
@@ -55,12 +55,15 @@ func (s *File) Fragments(ctx context.Context, yield FragmentsFunc) error {
|
|||||||
// and fall back on treating it like a normal file and let fileFragments
|
// and fall back on treating it like a normal file and let fileFragments
|
||||||
// decide what to do with it.
|
// decide what to do with it.
|
||||||
if err == nil && format != nil {
|
if err == nil && format != nil {
|
||||||
if (s.archiveDepth+1 > s.MaxArchiveDepth) && s.MaxArchiveDepth != 0 {
|
if s.archiveDepth+1 > s.MaxArchiveDepth {
|
||||||
logging.Warn().Str(
|
// Only warn when the feature is enabled
|
||||||
"path", s.FullPath(),
|
if s.MaxArchiveDepth != 0 {
|
||||||
).Int(
|
logging.Warn().Str(
|
||||||
"max_archive_depth", s.MaxArchiveDepth,
|
"path", s.FullPath(),
|
||||||
).Msg("skipping archive: exceeds max archive depth")
|
).Int(
|
||||||
|
"max_archive_depth", s.MaxArchiveDepth,
|
||||||
|
).Msg("skipping archive: exceeds max archive depth")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if extractor, ok := format.(archives.Extractor); ok {
|
if extractor, ok := format.(archives.Extractor); ok {
|
||||||
|
|||||||
Reference in new issue
Block a user