MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / writeRulesFile

Method writeRulesFile

src/helper/linux/firewallcontroller.cpp:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool FirewallController::writeRulesFile(bool ipv6, const std::string &rules)
114{
115 const char *path = ipv6 ? WS_LINUX_RUN_DIR "/rules.v6" : WS_LINUX_RUN_DIR "/rules.v4";
116 if (!IO::writeFile(path, rules, S_IRUSR | S_IWUSR)) {
117 spdlog::error("Could not write firewall rules: {}", IO::strerror(errno));
118 return false;
119 }
120 return true;
121}
122
123bool FirewallController::restoreRules(bool ipv6, bool testOnly)
124{

Callers

nothing calls this directly

Calls 2

strerrorFunction · 0.85
writeFileFunction · 0.50

Tested by

no test coverage detected