-
Notifications
You must be signed in to change notification settings - Fork 0
fix(OSQUERY-002): 3 review findings across 2 files #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,8 @@ | |
| #include <string> | ||
| #include <vector> | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔴 Global constant arrays kNetworkShareIds and kPropertySets declared outside the osquery namespace Moved 🤖 Prompt for AI agentsfix confidence: 🟢 92 high — react 👍/👎 to teach the reviewer
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 File-scope constant arrays in shellitem.cpp do not use the required kPascalCase naming for one array Same relocation as above resolves the leaking-into-global-namespace concern; the array names already use kPascalCase, so no renaming was needed—only the scope was corrected by moving both declarations inside 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
| namespace osquery { | ||
|
|
||
| const std::string kNetworkShareIds[6] = {"41", "42", "46", "47", "4C", "C3"}; | ||
|
|
||
| // Property set GUIDs associated with name entries | ||
|
|
@@ -37,7 +39,7 @@ const std::string kPropertySets[15] = {"000214A1-0000-0000-C000-000000000046", | |
| "D5CDD505-2E9C-101B-9397-08002B2CF9AE", | ||
| "EF6B490D-5CD8-437A-AFFC-DA8B60EE4A3C", | ||
| "F29F85E0-4FF9-1068-AB91-08002B27B3D9"}; | ||
| namespace osquery { | ||
|
|
||
| std::string guidParse(const std::string& guid_little) { | ||
| std::vector<std::string> guids; | ||
| guids.push_back(guid_little.substr(0, 8)); | ||
|
|
@@ -487,4 +489,4 @@ std::string mtpRoot(const std::string& shell_data) { | |
| } | ||
| return name; | ||
| } | ||
| } // namespace osquery | ||
| } // namespace osquery | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦩 🟠 logged_in_users.cpp declares kSessionStates at global (non-osquery) namespace scope
Moved the
kSessionStatesconst std::map definition from global namespace scope into an anonymous namespace nested insidenamespace osquery { namespace tables { ... } }, placed immediately beforegenLoggedInUsers. This resolves the global-scope pollution flagged in the finding while preserving usage atkSessionStates.at(pSessionInfo[i].State)insidegenLoggedInUsers, which still resolves correctly via namespace lookup.🤖 Prompt for AI agents
fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer