Repository navigation
fix(OSQUERY-007): CU-86akhf8u2 3 review findings across 3 files #101
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 |
|---|---|---|
|
|
@@ -38,6 +38,8 @@ const std::set<std::string> kHomebrewPrefixes = { | |
| "/opt/homebrew", | ||
| }; | ||
|
|
||
| namespace { | ||
|
|
||
| std::vector<std::string> getHomebrewAppInfoPlistPaths(const std::string& root) { | ||
|
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 helper functions in homebrew_packages.cpp are not anonymous-namespace or static Wrapped all file-local helper functions (getHomebrewAppInfoPlistPaths, getHomebrewNameFromInfoPlistPath, getHomebrewVersionsFromInfoPlistPath, checkAutoUpdatesInRubyFile, getBooleanValueFromJsonFile, getAppNameFromJsonManifest, getAppNameFromRubyManifest, getMetadataFileForCask, getHomebrewAutoUpdate, getInstalledAppNameFromMetadata, computeVersionsForFormulas, computeVersionsForCasks, packagesFromPrefix) inside an anonymous π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| std::vector<std::string> results; | ||
| auto status = osquery::listDirectoriesInDirectory(root, results); | ||
|
|
@@ -338,6 +340,8 @@ void packagesFromPrefix(QueryData& results, | |
| computeVersionsForCasks(results, prefix, userRequested); | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| QueryData genHomebrewPackages(QueryContext& context) { | ||
| QueryData results; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,11 @@ | |
| #include <algorithm> | ||
| #include <string> | ||
|
|
||
| namespace osquery { | ||
| namespace tables { | ||
|
|
||
| namespace { | ||
|
|
||
| const int kWin8 = 256; | ||
|
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. 𦩠π shimcache.cpp declares file-scope constants and struct outside any namespace Moved π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
| const int kWin10PreCreator = 96; | ||
| const int kWin10Creator = 104; | ||
|
|
@@ -44,8 +49,7 @@ struct ShimcacheData { | |
| boost::optional<bool> execution_flag; | ||
| }; | ||
|
|
||
| namespace osquery { | ||
| namespace tables { | ||
| } // namespace | ||
|
|
||
| auto parseShimcacheData(const std::string& token, | ||
| const boost::optional<bool>& execution_flag_exists) { | ||
|
|
@@ -227,3 +231,4 @@ QueryData genShimcache(QueryContext& context) { | |
|
|
||
| } // namespace tables | ||
| } // 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.
𦩠π appendQuotedString is unused and placed at exported namespace scope instead of anonymous namespace
Removed the unused, exported
appendQuotedStringfunction fromosquery/events/darwin/es_utils.cpp(previously defined at file scope innamespace osquery, near the end of the file aftergetProcessProperties). Since the finding confirms zero callers anywhere in the org, deletion (the "remove if leftover scaffolding" option offered) is the minimal fix rather than adding an anonymous namespace around dead code; this also removes the now-unneeded<iomanip>usage site (header left in place since it's still a plausible general-purpose include, and removing it is out of scope for this finding).π€ Prompt for AI agents
fix confidence: π‘ 85 medium β react π/π to teach the reviewer