From b3f3f73234cf547d8c1d6df365c525a2893281a3 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Thu, 9 Feb 2023 11:34:57 +0100 Subject: [PATCH 1/4] remove unneeded go.mod which triggers a warning in IJ --- dist/go.mod | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dist/go.mod diff --git a/dist/go.mod b/dist/go.mod deleted file mode 100644 index ff0d3da7..00000000 --- a/dist/go.mod +++ /dev/null @@ -1 +0,0 @@ -// Ignore sub-tree From e5161ef696b49716a3b2964e6fa815597c996c76 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Thu, 9 Feb 2023 12:33:22 +0100 Subject: [PATCH 2/4] Match collector_binaries_accesslist case insensitive on windows Fixes #364 --- helpers/helper.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/helpers/helper.go b/helpers/helper.go index 4c09b591..e7db7319 100644 --- a/helpers/helper.go +++ b/helpers/helper.go @@ -212,7 +212,14 @@ func PathMatch(path string, patternList []string) (PathMatchResult, error) { } for _, pattern := range patternList { - match, err := filepath.Match(pattern, result.Path) + var match bool + var err error + if runtime.GOOS == "windows" { + // ignore case on windows + match, err = filepath.Match(strings.ToLower(pattern), strings.ToLower(result.Path)) + } else { + match, err = filepath.Match(pattern, result.Path) + } if err != nil { result.Match = false return result, err From d23eab701d4e17b80bf2ea4b550a3d24193e6cf8 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Thu, 9 Feb 2023 12:38:38 +0100 Subject: [PATCH 3/4] also for macos --- helpers/helper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/helper.go b/helpers/helper.go index e7db7319..52edc6db 100644 --- a/helpers/helper.go +++ b/helpers/helper.go @@ -214,8 +214,8 @@ func PathMatch(path string, patternList []string) (PathMatchResult, error) { for _, pattern := range patternList { var match bool var err error - if runtime.GOOS == "windows" { - // ignore case on windows + if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { + // ignore case on windows and MacOS. Both have usually case-insensitive filesystems. match, err = filepath.Match(strings.ToLower(pattern), strings.ToLower(result.Path)) } else { match, err = filepath.Match(pattern, result.Path) From a936f4639c98e93b18a88c1dd3d3010dba6404a4 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Fri, 10 Feb 2023 09:39:30 +0100 Subject: [PATCH 4/4] changelog --- changelog/unreleased/issue-364.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/issue-364.toml diff --git a/changelog/unreleased/issue-364.toml b/changelog/unreleased/issue-364.toml new file mode 100644 index 00000000..221f667f --- /dev/null +++ b/changelog/unreleased/issue-364.toml @@ -0,0 +1,6 @@ +type = "fixed" +message = "Match collector_binaries_accesslist case insensitive on Windows and MacOS." + +issues = ["364"] +pulls = ["467"] +