fix(OSQUERY-004): 2 review findings in process.cpp - #44
Conversation
| ::execve(arguments[0], argv, ::environ); | ||
|
|
||
| // Code should never reach this point | ||
| std::cerr << "Could not start extension process: " << exec_path | ||
| << ", error: " << errno << std::endl; | ||
| LOG(ERROR) << "Could not start extension process: " << exec_path | ||
| << ", error: " << errno; | ||
| ::exit(EXIT_FAILURE); | ||
| return std::shared_ptr<PlatformProcess>(); | ||
| } |
There was a problem hiding this comment.
🦩 🟠 std::cerr used for diagnostic output instead of LOG() macros in process.cpp
In launchExtension() (osquery/process/posix/process.cpp), replaced std::cerr << "Could not start extension process: " << exec_path << ", error: " << errno << std::endl; with LOG(ERROR) << "Could not start extension process: " << exec_path << ", error: " << errno;, matching the existing LOG(ERROR) style used in launchWorker(). No other logic changed.
🤖 Prompt for AI agents
In osquery/process/posix/process.cpp around line 195, review and complete this code-review fix: std::cerr used for diagnostic output instead of LOG() macros in process.cpp.
What the draft fix changed: In launchExtension() (osquery/process/posix/process.cpp), replaced `std::cerr << "Could not start extension process: " << exec_path << ", error: " << errno << std::endl;` with `LOG(ERROR) << "Could not start extension process: " << exec_path << ", error: " << errno;`, matching the existing LOG(ERROR) style used in launchWorker(). No other logic changed.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer
| @@ -233,8 +233,8 @@ std::shared_ptr<PlatformProcess> PlatformProcess::launchTestPythonScript( | |||
| std::string args = boost::algorithm::join(args_array, " "); | |||
There was a problem hiding this comment.
🦩 🟠 std::cerr used for diagnostic output in launchTestPythonScript
In launchTestPythonScript() (osquery/process/posix/process.cpp), replaced std::cerr << "Could not start process at " << osquery_python_path << ", args: " << args << ", error: " << errno << std::endl; with LOG(ERROR) << "Could not start process at " << osquery_python_path << ", args: " << args << ", error: " << errno;. The <iostream> include was left in place since it is not strictly required to be removed by the finding and removing it would be a drive-by change beyond scope.
🤖 Prompt for AI agents
In osquery/process/posix/process.cpp around line 233, review and complete this code-review fix: std::cerr used for diagnostic output in launchTestPythonScript.
What the draft fix changed: In launchTestPythonScript() (osquery/process/posix/process.cpp), replaced `std::cerr << "Could not start process at " << osquery_python_path << ", args: " << args << ", error: " << errno << std::endl;` with `LOG(ERROR) << "Could not start process at " << osquery_python_path << ", args: " << args << ", error: " << errno;`. The `<iostream>` include was left in place since it is not strictly required to be removed by the finding and removing it would be a drive-by change beyond scope.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer
Closes 2 review findings in
osquery/process/posix/process.cpp.Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
osquery/process/posix/process.cpp:195osquery/process/posix/process.cpp:233What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
01e7aadc-0204-47ef-b373-fc5dbadf3ab5Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.