From bbe1161dc2492b6659112dbc7ca2d81ce8fbecec Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:18:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20Fail2ban=20?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=96=B9=E5=BC=8F=E5=88=87=E6=8D=A2=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#3704)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/fail2ban.go | 2 +- backend/utils/firewall/client/firewalld.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/service/fail2ban.go b/backend/app/service/fail2ban.go index 59684ccc0..a881cd66a 100644 --- a/backend/app/service/fail2ban.go +++ b/backend/app/service/fail2ban.go @@ -107,7 +107,7 @@ func (u *Fail2BanService) UpdateConf(req dto.Fail2BanUpdate) error { if req.Value == "firewallcmd-ipset" || req.Value == "ufw" { itemName := "ufw" if req.Value == "firewallcmd-ipset" { - itemName = "firewallcmd" + itemName = "firewalld" } client, err := firewall.NewFirewallClient() if err != nil { diff --git a/backend/utils/firewall/client/firewalld.go b/backend/utils/firewall/client/firewalld.go index 569e286d0..4c9a2a723 100644 --- a/backend/utils/firewall/client/firewalld.go +++ b/backend/utils/firewall/client/firewalld.go @@ -106,6 +106,7 @@ func (f *Firewall) ListPort() ([]FireInfo, error) { } itemRule := f.loadInfo(rule) if len(itemRule.Port) != 0 && itemRule.Family == "ipv4" { + itemRule.Family = "" datas = append(datas, itemRule) } }