From 19ce10a7bfa2ac5bf5e61e85d88028ee41575bc3 Mon Sep 17 00:00:00 2001 From: Preslav Gerchev Date: Mon, 8 Jan 2024 13:55:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fix=20windows=20build.=20(#2978)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Preslav --- providers/os/detector/windows/build_version_windows.go | 3 +-- providers/os/detector/windows/wmi_windows.go | 3 +-- providers/os/id/platformid/win_guid_windows.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/providers/os/detector/windows/build_version_windows.go b/providers/os/detector/windows/build_version_windows.go index 81812ae142..48ccaf4b56 100644 --- a/providers/os/detector/windows/build_version_windows.go +++ b/providers/os/detector/windows/build_version_windows.go @@ -9,14 +9,13 @@ package windows import ( "runtime" - "go.mondoo.com/cnquery/v9/providers/os/connection" "go.mondoo.com/cnquery/v9/providers/os/connection/shared" "golang.org/x/sys/windows/registry" ) func GetWindowsOSBuild(conn shared.Connection) (*WindowsCurrentVersion, error) { // if we are running locally on windows, we want to avoid using powershell to be faster - if conn.Type() == connection.Local && runtime.GOOS == "windows" { + if conn.Type() == shared.Type_Local && runtime.GOOS == "windows" { k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) if err != nil { return nil, err diff --git a/providers/os/detector/windows/wmi_windows.go b/providers/os/detector/windows/wmi_windows.go index dcb4cf8496..51ec148382 100644 --- a/providers/os/detector/windows/wmi_windows.go +++ b/providers/os/detector/windows/wmi_windows.go @@ -12,7 +12,6 @@ import ( "strconv" wmi "github.com/StackExchange/wmi" - "go.mondoo.com/cnquery/v9/providers/os/connection" "go.mondoo.com/cnquery/v9/providers/os/connection/shared" ) @@ -20,7 +19,7 @@ const wmiOSQuery = "SELECT Name, Caption, Manufacturer, OSArchitecture, Version, func GetWmiInformation(conn shared.Connection) (*WmicOSInformation, error) { // if we are running locally on windows, we want to avoid using powershell to be faster - if conn.Type() == connection.Local && runtime.GOOS == "windows" { + if conn.Type() == shared.Type_Local && runtime.GOOS == "windows" { // we always get a list or entries type win32_OperatingSystem struct { diff --git a/providers/os/id/platformid/win_guid_windows.go b/providers/os/id/platformid/win_guid_windows.go index 9aca9a19d8..14e6601b73 100644 --- a/providers/os/id/platformid/win_guid_windows.go +++ b/providers/os/id/platformid/win_guid_windows.go @@ -11,13 +11,12 @@ import ( "runtime" wmi "github.com/StackExchange/wmi" - "go.mondoo.com/cnquery/v9/providers/os/connection" "go.mondoo.com/cnquery/v9/providers/os/connection/shared" ) func windowsMachineId(conn shared.Connection) (string, error) { // if we are running locally on windows, we want to avoid using powershell to be faster - if conn.Type() == connection.Local && runtime.GOOS == "windows" { + if conn.Type() == shared.Type_Local && runtime.GOOS == "windows" { // we always get a list or entries type win32ComputerSystemProduct struct { UUID *string