From 80c8635f2386dfb2c518de64a4cf4037edbaa08e Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 7 May 2022 00:48:55 +0300 Subject: [PATCH] kfirewall: pass long options to iptables Signed-off-by: Ivailo Monev --- kfirewall/kcm/kfirewallhelper.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kfirewall/kcm/kfirewallhelper.cpp b/kfirewall/kcm/kfirewallhelper.cpp index 26f32032..8f9c883d 100644 --- a/kfirewall/kcm/kfirewallhelper.cpp +++ b/kfirewall/kcm/kfirewallhelper.cpp @@ -45,25 +45,25 @@ static QByteArray rulesForParameters(const QVariantMap ¶meters, const bool a } if (appendrules) { - iptablesruledata.append("-A "); + iptablesruledata.append("--append "); } else { - iptablesruledata.append("-D "); + iptablesruledata.append("--delete "); } iptablesruledata.append(iptablestraffic); if (!addressvalue.isEmpty()) { - iptablesruledata.append(" -d "); + iptablesruledata.append(" --destination "); iptablesruledata.append(addressvalue.toUpper()); } if (portvalue > 0) { - iptablesruledata.append(" -p tcp --dport "); + iptablesruledata.append(" --proto tcp --dport "); iptablesruledata.append(QByteArray::number(portvalue)); } if (!isinbound) { // NOTE: only output can be user-bound - iptablesruledata.append(" -m owner --uid-owner "); + iptablesruledata.append(" --match owner --uid-owner "); iptablesruledata.append(uservalue); } - iptablesruledata.append(" -j "); + iptablesruledata.append(" --jump "); iptablesruledata.append(actionvalue.toUpper()); iptablesruledata.append("\n"); } -- 2.11.0