/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 - 2023 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
bool Rule::compareFieldType(const Rule &rule)
{
- for (auto c : rule.condition) {
+ for (auto &c : rule.condition) {
if (c.first == FieldType::Tag)
continue;
bool Rule::compareCondition(Rule &rule)
{
- for (auto c : condition) {
+ for (auto &c : condition) {
if (c.first == FieldType::Tag)
continue;
auto manager = client.createInterface<RuleManagement>();
auto rulesData = manager.getRules();
- for (auto data : rulesData) {
+ for (auto &data : rulesData) {
audit_rule_h rule;
try {
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 - 2023 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void BaseRuleSet::addDir(const std::vector<std::string>& dirs,
unsigned int perm, Result result)
{
- for (auto dir : dirs) {
+ for (auto &dir : dirs) {
WatchDirRule rule(dir, perm);
setMaskFileSystemcalls(rule, perm);
void BaseRuleSet::addPath(const std::vector<std::string>& paths,
unsigned int perm, Result result)
{
- for (auto path : paths) {
+ for (auto &path : paths) {
WatchPathRule rule(path, perm);
setMaskFileSystemcalls(rule, perm);
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 - 2023 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void RuleApplyEngine::apply(Audit &audit)
{
- for (auto r : audit.getRules()) {
+ for (auto &r : audit.getRules()) {
audit.removeRule(r.data());
}
if (optimizedList.size() < 2)
return;
- for (auto r : optimizedList) {
+ for (auto &r : optimizedList) {
audit.addRule(r.data());
}
}