| 749 | } |
| 750 | |
| 751 | uint32_t Daemon::appendRule(const std::string& rule_spec, |
| 752 | uint32_t parent_id, bool permanent) |
| 753 | { |
| 754 | USBGUARD_LOG(Trace) << "entry:" |
| 755 | << " rule_spec=" << rule_spec |
| 756 | << " parent_id=" << parent_id; |
| 757 | const Rule rule = Rule::fromString(rule_spec); |
| 758 | /* TODO: reevaluate the firewall rules for all active devices */ |
| 759 | const uint32_t id = _policy.appendRule(rule, parent_id); |
| 760 | |
| 761 | if ((_config.hasSettingValue("RuleFile") || _config.hasSettingValue("RuleFolder")) && permanent) { |
| 762 | _policy.save(); |
| 763 | } |
| 764 | |
| 765 | USBGUARD_LOG(Trace) << "return: id=" << id; |
| 766 | return id; |
| 767 | } |
| 768 | |
| 769 | void Daemon::removeRule(uint32_t id) |
| 770 | { |
no test coverage detected