MCPcopy Create free account
hub / github.com/USBGuard/usbguard / appendRule

Method appendRule

src/Daemon/Daemon.cpp:751–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

generateMethod · 0.45
dmHookDeviceEventMethod · 0.45
usbguard_append_ruleFunction · 0.45

Calls 2

hasSettingValueMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected