| 111 | } |
| 112 | |
| 113 | bool 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 | |
| 123 | bool FirewallController::restoreRules(bool ipv6, bool testOnly) |
| 124 | { |