From e26b1d7578642a3c27e00d87692c8290dfa8bf9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reigota?= Date: Wed, 12 May 2021 18:00:52 +0100 Subject: [PATCH] Fix bug with invalid log path #3155 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Reigota --- internal/console/printer/printer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/console/printer/printer.go b/internal/console/printer/printer.go index c04a50eca7c..51bc7d0d7a9 100644 --- a/internal/console/printer/printer.go +++ b/internal/console/printer/printer.go @@ -1,7 +1,6 @@ package printer import ( - "errors" "io" "os" "path/filepath" @@ -12,6 +11,7 @@ import ( consoleHelpers "github.com/Checkmarx/kics/internal/console/helpers" "github.com/Checkmarx/kics/internal/constants" "github.com/gookit/color" + "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/pflag" @@ -227,7 +227,8 @@ func LogPath(opt interface{}, changed bool) error { return err } } - loggerFile, err = os.OpenFile(filepath.Clean(logPath), os.O_CREATE|os.O_WRONLY, os.ModePerm) + + loggerFile, err = os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, os.ModePerm) if err != nil { return err }