From efed3c212ef40a0087bf020c9d87660021d9b33e Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 05:24:07 +0000 Subject: [PATCH 1/4] fix(OSQUERY-004-2): 8 review findings across 4 files --- osquery/core/windows/wmi.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osquery/core/windows/wmi.cpp b/osquery/core/windows/wmi.cpp index 89c821a97d0..34531bb10d2 100644 --- a/osquery/core/windows/wmi.cpp +++ b/osquery/core/windows/wmi.cpp @@ -77,13 +77,13 @@ void WmiResultItem::PrintType(const std::string& name) const { VARIANT value; HRESULT hr = result_->Get(property_name.c_str(), 0, &value, nullptr, nullptr); if (hr != S_OK) { - std::cerr << "Failed: " << name << "\n"; + LOG(INFO) << "Failed: " << name; } else { - std::cout << "Name=" << name << ", Type=" << value.vt << "\n"; + VLOG(1) << "Name=" << name << ", Type=" << value.vt; if (value.vt == VT_I4) { - std::cout << " Value=" << value.lVal << "\n"; + VLOG(1) << " Value=" << value.lVal; } else if (value.vt == VT_BSTR) { - std::wcout << " Value=" << value.bstrVal << "\n"; + VLOG(1) << " Value=" << wstringToString(value.bstrVal); } } VariantClear(&value); @@ -238,7 +238,7 @@ Status WmiResultItem::GetUnsignedLong(const std::string& name, VariantClear(&value); return Status::failure("Invalid data type returned."); } - ret = value.lVal; + ret = value.ulVal; VariantClear(&value); return Status::success(); } @@ -255,7 +255,7 @@ Status WmiResultItem::GetLongLong(const std::string& name, VariantClear(&value); return Status::failure("Invalid data type returned."); } - ret = value.lVal; + ret = value.llVal; VariantClear(&value); return Status::success(); } @@ -272,7 +272,7 @@ Status WmiResultItem::GetUnsignedLongLong(const std::string& name, VariantClear(&value); return Status::failure("Invalid data type returned."); } - ret = value.lVal; + ret = value.ullVal; VariantClear(&value); return Status::success(); } From 38e9b87c3dc574bba260167e9f7da13f9add056d Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 05:24:08 +0000 Subject: [PATCH 2/4] fix(OSQUERY-004-2): 8 review findings across 4 files --- plugins/logger/filesystem_logger.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/logger/filesystem_logger.cpp b/plugins/logger/filesystem_logger.cpp index f6004f0b6f7..74b90f9984f 100644 --- a/plugins/logger/filesystem_logger.cpp +++ b/plugins/logger/filesystem_logger.cpp @@ -32,8 +32,7 @@ namespace { bool validateLoggerMode(const char* flagname, const std::string& value) { // Account for leading 0, special bit, and normal permissions if (value.size() > 5) { - osquery::systemLog(kLoggerModeInvalidValueError); - std::cerr << kLoggerModeInvalidValueError << std::endl; + LOG(ERROR) << kLoggerModeInvalidValueError; return false; } @@ -41,8 +40,7 @@ bool validateLoggerMode(const char* flagname, const std::string& value) { const auto logger_mode_octal_exp = tryTo(value, 8); if (logger_mode_octal_exp.isError()) { - osquery::systemLog(kLoggerModeConversionFailureError); - std::cerr << kLoggerModeConversionFailureError << std::endl; + LOG(ERROR) << kLoggerModeConversionFailureError; return false; } @@ -50,8 +48,7 @@ bool validateLoggerMode(const char* flagname, const std::string& value) { const auto logger_mode_octal = logger_mode_octal_exp.get(); if (logger_mode_octal <= 0 || logger_mode_octal > 07777) { - osquery::systemLog(kLoggerModeInvalidValueError); - std::cerr << kLoggerModeInvalidValueError << std::endl; + LOG(ERROR) << kLoggerModeInvalidValueError; return false; } @@ -320,3 +317,4 @@ void FilesystemLoggerPlugin::init(const std::string& name, FLAGS_stderrthreshold = stderr_threshold; } } // namespace osquery + From 45955a70d8dbad83dfb710a295fb4c9a43667ed0 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 08:24:09 +0300 Subject: [PATCH 3/4] fix(OSQUERY-004-2): 8 review findings across 4 files --- plugins/config/parsers/file_paths.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/config/parsers/file_paths.cpp b/plugins/config/parsers/file_paths.cpp index 6c3f0eb03d4..689fbfb18c4 100644 --- a/plugins/config/parsers/file_paths.cpp +++ b/plugins/config/parsers/file_paths.cpp @@ -144,7 +144,7 @@ void FilePathsConfigParserPlugin::updateFilePathsQuery( for (const auto& row : sql.rows()) { auto pathIt = row.find("path"); if (pathIt == row.end()) { - LOG(ERROR) << "Cold not find non-empty 'path' column in the " + LOG(ERROR) << "Could not find non-empty 'path' column in the " "results of file_paths_query '" << query.GetString() << "'"; } else { From f7b4a0b09054139f86a976c7d5d153483bdb0201 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 05:24:10 +0000 Subject: [PATCH 4/4] fix(OSQUERY-004-2): 8 review findings across 4 files --- osquery/events/windows/etw/etw_user_session.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osquery/events/windows/etw/etw_user_session.cpp b/osquery/events/windows/etw/etw_user_session.cpp index af0b0680e89..3b6ab577bf8 100644 --- a/osquery/events/windows/etw/etw_user_session.cpp +++ b/osquery/events/windows/etw/etw_user_session.cpp @@ -153,6 +153,7 @@ void UserEtwSessionRunnable::resume() { void UserEtwSessionRunnable::initUserTraceSession( const std::string& sessionName) { if (sessionName.empty()) { + LOG(ERROR) << "UserTraceSession does not have a name."; return; } @@ -176,6 +177,7 @@ void UserEtwSessionRunnable::initUserTraceSession( void UserEtwSessionRunnable::stopUserTraceSession( const std::string& sessionName) { if (sessionName.empty()) { + LOG(ERROR) << "Failed to stop user trace session, session name is empty."; return; } @@ -201,4 +203,4 @@ void UserEtwSessionRunnable::stopUserTraceSession( LOG(WARNING) << "ControlTrace() failed with error code " << retCtrl; } } -} // namespace osquery \ No newline at end of file +} // namespace osquery