Skip to content
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

file: Add Shortcut metadata parsing on Windows #8143

Merged
merged 6 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions osquery/core/tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,20 @@ Status QueryContext::expandConstraints(
ConstraintOperator op,
std::set<std::string>& output,
std::function<Status(const std::string& constraint,
std::set<std::string>& output)> predicate) {
for (const auto& constraint : constraints[column].getAll(op)) {
std::set<std::string>& output)> predicate) const {
auto constraint_it = constraints.find(column);

if (constraint_it == constraints.end()) {
return Status::success();
}

for (const auto& constraint : constraint_it->second.getAll(op)) {
auto status = predicate(constraint, output);
if (!status) {
return status;
}
}
return Status(0);
return Status::success();
}

Status deserializeQueryContextJSON(const JSON& json_helper,
Expand Down
2 changes: 1 addition & 1 deletion osquery/core/tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ struct QueryContext {
ConstraintOperator op,
std::set<std::string>& output,
std::function<Status(const std::string& constraint,
std::set<std::string>& output)> predicate);
std::set<std::string>& output)> predicate) const;

/// Check if the given column is used by the query
bool isColumnUsed(const std::string& colName) const;
Expand Down
Loading
Loading